I have a form with two groups of radio buttons. Let's call them the left and right groups. When the user clicks on a certain radio button from the left group (the one with the value of '5', all radio buttons in the right group are disabled. I have this part working. What I need to do though is disable all radio buttons in the right group with the exception of the radio button with the value of '9'.
Can anyone help me modify my js to handle this? Thanks!
Thanks again!
Can anyone help me modify my js to handle this? Thanks!
Code:
Left group...
<input type="radio" id="pkg#qGet_pkgs.pkg_id#" name="pkg_name" value="#qGet_pkgs.pkg_id#" onclick="toggleGroup(this.form.prog_name, this)">
Right group...
<input type="radio" id="prog#qGet_prog.prog_id#" name="prog_name" value="#qGet_prog.prog_id#">
JS...
function toggleGroup(obj, src) {
var val = src.checked && (src.value=='5');
for (var i = 0; i < obj.length; i++) {
obj[i].disabled = val;
obj[i].checked = false;
}
Thanks again!