Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

show hide when a certian option is selected

Status
Not open for further replies.

8ginga8

Programmer
Dec 14, 2004
54
CA
I have this dropdown
Code:
<select name="dropdown">
                            <option value="No selection">Make a Selection</option>
                            <option value="test1">test1</option>
                            <option value="test2">test2</option>
                            
                            <option value="Other" >Other</option>
                          </select>
what i would like to acheive is when some one select other they are given a text area to type in. But I would like to have it hidden until they select other from the drop down
 
given this text box:

Code:
<input type="text" name="t1" style="display:none;" />

you can use this code in your select:

Code:
<select name="dropdown" onchange="this.form.t1.style.display = (this.selectedIndex == 3) ? 'block' : 'none';">



*cLFlaVA
----------------------------
[tt]( <P> <B>)13 * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top