value of a drop down box

G

Guest

hello,

i need to retrieve the value of a drop down box with javascript. which
property of the script allows me to do that (other than this.value)?

thanks.

Xero
 
S

Steve Easton

Here's a sample for a hyperlink to a different web site in a new browser window.

<form>
<p align="center"><b>Select a site </b>
<select id="Choice" style="color: #0000FF" size="1" name="mySelect">
<option value="">Select one</option>
<option value="http://altavista.com">AltaVista</option>
<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.google.com">Google</option>
</select>
<input type="button" value="Go"
onclick="window.open(Choice.options[Choice.selectedIndex].value)">
</p>
</form >


--

Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm
 
G

Guest

i see.
thanks very much!!

David Berry said:
var txtThisValue = document.f1.m1[document.f1.m1.selectedIndex].value

--
David Berry
Microsoft MVP - FrontPage
FrontPage Support: http://www.frontpagemvps.com/
-----------------------------------
To assist you in getting the best answers for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
-----------------------------------


Xero said:
hello,

i need to retrieve the value of a drop down box with javascript. which
property of the script allows me to do that (other than this.value)?

thanks.

Xero
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top