This is a question more suitable for a javascript group. And I would still urge you to drop those CGI helpers and write raw HTML. Then you would fit into a web developer group and get (hopefully) good help from there.
Aaanyway, if you are willing to ignore the cosmetic aspects, you would be better off doing this in your submission code (you need to prioritise the "E" checkbox over the others.) You will need to deal with it in the submission code anyway. There might be other checkboxes checked even if the "E" one is already checked.
Anyway, the javascript-osmosis person that I am, here seems to be a workable function. I honestly don't know if it is in any way cross-browser compatible or anything.
function toggleOther (elName, ignore) { var buttons = document.getElementsByName(elName); var disable = false; if (ignore.checked) { disable = true; } for (var i = 0; i < buttons.length; i++) { if (buttons[i] == ignore) { next; } buttons[i].disabled = disable; } }
And it is called like this:
<input type="checkbox" name="GRU$Za" value="E" onclick="toggleOther('G +RU$Za', this)" />
In reply to Re: How to uncheck one checkbox if some other is checked
by Anonymous Monk
in thread How to uncheck one checkbox if some other is checked
by SerZKO
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |