So I have the following JavaScript code:
<script type="text/javascript">
function clearRadioButtons()
{
document.getElementById("radiobutton1").checked="";
//etc for more radio buttons
}
</script>
And then in my form, I have the following code:
<select name="whatever" onclick="clearRadioButtons()">
<option onclick="clearRadioButtons()"></option>
//and so on and so forth for <option> tags with values
</select>
The problem is that the function is never actually called even if I click on the select
or option
elements. If I call the JS function in my browser's debugger, it works fine, but the event is not being triggered. What am I doing wrong here? I have the feeling that it's pretty simple, but who knows.
TIA.