Can you help me with a script to enable/disable a dropdown based on the checkbox status?
<body onload="enableDropdown(false);">
<form name="form1" method="post" onload="enableDropdown(false);">
<input type="checkbox" name="others" onclick="enableDropdown(this.checked)" >Others
<select id="selected_opt">
<option value="x">X</option>
<option value="y" selected>Y</option>
<option value="z">Z</option>
</select></form>
Here is the Javascript code:
function enableDropdown(bool)
{
bool = !bool;
document.form1.selected_opt.disabled = bool;
}