Forum Moderators: open

Message Too Old, No Replies

Help with a form

         

nfs2

9:00 am on Apr 16, 2006 (gmt 0)

10+ Year Member



I have a form, with a text box that should only be showed if a certain option of the drop down box above it is chosen

For example;

<tr>
<td>Pick a category:</td>
<td><select name="category">
<option value="cat1">Category one</option>
<option value="cat2">Category two</option>
<option value="create">Create a new category</option>
</select></td>
</tr>
//everything below this should only show if the "create a new category" option is selected
<tr>
<td>Create a new category</td>
<td><input type="text" name="create" /></td>
</tr>

Any ideas on how to do that?

Moby_Dim

5:39 pm on Apr 16, 2006 (gmt 0)

10+ Year Member



You have to make this input text field "hidden" (css visibility property) by default, and to create onchange event handler for select. If the value choosen == "create", then set the text field css visibility property to "visible".