PDA

View Full Version : js event?



abs0lut
08-17-2008, 08:47 AM
<option>yes</option>
<option>no</option>
When I select yes in the dropdown without pressing submit button, it will show an input field. is it possible in javascript? could you please help me?

DimX
08-17-2008, 09:52 AM
<form name="aform" action="#">
<select onchange="this.form.elements['nofkids'].style.display = this.value">
<option value="">Yes</option>
<option value="none">No</option>
</select>
<input type="text" name="nofkids">
</form>

This will also hide the field when you select "No".

abs0lut
08-17-2008, 12:01 PM
thank you very much