Hi I am attempting to write some code which disables enables a list box from a checkbox. I just get an error message syntax error. can anyone help and explain what I did wrong.
thanks
<script type="text/javascript">
function enableField() {
If (document.form1.checkbox.value == true)
{ document.form1.select.disabled=false; }
else
{ document.form1.select.disabled=true; }
}
</script>
</p>
<p> </p>
<form action="" method="post" name="form1">
<input name="checkbox" type="checkbox" value="Enable" onClick="enableField();">
<select name="select" size="1" multiple disabled="true">
<option value="tennis">tennis</option>
<option value="soupe">soupe</option>
</select>
</form>
Angus
thanks
<script type="text/javascript">
function enableField() {
If (document.form1.checkbox.value == true)
{ document.form1.select.disabled=false; }
else
{ document.form1.select.disabled=true; }
}
</script>
</p>
<p> </p>
<form action="" method="post" name="form1">
<input name="checkbox" type="checkbox" value="Enable" onClick="enableField();">
<select name="select" size="1" multiple disabled="true">
<option value="tennis">tennis</option>
<option value="soupe">soupe</option>
</select>
</form>
Angus