Disable Fields in a Form



Enable
Disable


Selecting the disable radio button above disables the select option box. That means you will not be able to click on it.

Here is the code.
<form name="myform">

<input type="radio" name="colorrobot" value="yes" checked
onClick="myform.selectcolor.disabled=false;
mylabel.style.color='black'">Enable<br>
<input type="radio" name="colorrobot" value="no"
onclick="myform.selectcolor.disabled=true;
mylabel.style.color='gray'">Disable<br>
<br><br>

<label id="mylabel">
Select a Color:
<select name="selectcolor">
<option selected>silver</option>
<option>gold</option>
<option>red</option>
<option>green</option>
<option>blue</option>
</select>
</label>

</form>



RETURN