Re: Getting Text and Value From Option/Select by McKirahan
McKirahan
Wed Oct 06 10:54:01 CDT 2004
"McKirahan" <News@McKirahan.com> wrote in message
news:0xU8d.190812$MQ5.8956@attbi_s52...
> "Geoff Robinson" <geoffr2@aol.com> wrote in message
> news:978b35e2.0410060734.4223c410@posting.google.com...
> > In VBScript how would someone get the text value from a pulldown
> > select/option list in HTML?
> >
> > If you look at the following html, I would like to get the text of
> > whatever is selected. "One" instead of "1". How would I go about doing
> > that in VBScript?
> >
> > <form name="myform">
> > <select name="selectname">
> > <option value="1">One</option>
> > <option value="2">Two</option>
> > </select>
> >
> > thanks for any help in advance,
> > Geoff
>
>
document.myform.selectname.options(document.myform.selectname.selectedIndex)
> .value
Ooops, change that to:
document.myform.selectname.options(document.myform.selectname.selectedIndex)
.text