Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Show/Hide text and form field based on drop down selection

Reply
Thread Tools

Show/Hide text and form field based on drop down selection

 
 
Steve Speirs
Guest
Posts: n/a
 
      06-27-2003
Hi

I'm trying to show/hide a simple piece of text and a text field on a
form based on what choice is made from a drop down box.

<select name="dropdown" size="1">
<option selected value="">Please make a selection</option>
<option value="1">Choice 1</option>
<option value="2">Choice 2</option>
<option value="3">Choice 3</option>
<option value="4">Other</option>
</select>

i.e. if Choice 2 is selected I'd like to display a new <tr> with the
following:

<tr>
<td>New text field:</td>
<td><input name="newField" type="text size="20"></td>
</tr>

if any other choices are made, I don't want to display anything.
I've tried several onchange() functions but can't achieve what I'm
looking for.

Any help would be appreciated,
Steve
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
1st Drop-down selection determins selected value in all drop-downs In ASP.Net Wizard jaysch ASP .Net 0 04-30-2011 02:19 PM
Automatic form field update based on previous form value selection Brett_A ASP General 8 04-19-2008 11:13 AM
Display row of Table Data based on Drop Down List Selection JamesW ASP .Net 0 09-10-2006 11:19 PM
update text field based on selection field pkinville@hotmail.com Javascript 13 01-28-2005 05:09 PM
Changing drop-down field to text field. ehm Javascript 2 09-24-2003 07:00 PM



Advertisments