Chon-Ji
06-26-2006, 08:25 AM
I need to make some of my form elements change depending on the action of the user. Here's a sample of my code...
<form>
<select>
<option value="Yes">YES</option>
<option selected value="No">No</option>
</select>
<input type="Text" value="" name="id" disabled />
<input type="Submit" value="Submit" name="submit" disabled />
</form>
The initial selection in the list box is "NO" and the form elements are initially disabled. Whenever the user select "YES" from the list box I need to enable the text field and submit button. Likewise if the user selects "NO" I have to disable the elements. Is there anyway I could do this in javascript?
thanks
<form>
<select>
<option value="Yes">YES</option>
<option selected value="No">No</option>
</select>
<input type="Text" value="" name="id" disabled />
<input type="Submit" value="Submit" name="submit" disabled />
</form>
The initial selection in the list box is "NO" and the form elements are initially disabled. Whenever the user select "YES" from the list box I need to enable the text field and submit button. Likewise if the user selects "NO" I have to disable the elements. Is there anyway I could do this in javascript?
thanks