2
I have these 3 checkbox
<td style="background-color: #D6FAFA"><input type="checkbox" name="box2" id="ok" /></td>
<td style="background-color: #D6FAFA"><input type="checkbox" name="box2" id="nok"/></td>
<td style="background-color: #D6FAFA"><input type="checkbox" name="box2" id="na"/></td>
By checking a checkbox with id = ok I can’t check the other two checkbox and do the same thing with the other checkbox, I’ll only be able to check if I have everything unchecked if one of them has checked the other hangs
I tried it didn’t work out
$(function() {
enable_cb();
$("#ok").click(enable_cb);
$("#nok").click(enable_cb);
$("#na").click(enable_cb);
});
function enable_cb() {
if (this.checked) {
$("#nok").attr("disabled",true);
$("#na").attr("disabled",true);
} else {
$("#nok").removeAttr("disabled");
$("#na").removeAttr("disabled");
}
}
can anyone tell me what is wrong, I am using jquery library.v1.9.1.
Why not use Radio Buttons? http://www.w3schools.com/html/tryit.asp?filename=tryhtml_radio
– Miguel
@Miguel It is a strange pattern even with radio buttons. What he wants is to disable the choices once one has been made. I can’t imagine a form that makes sense. If the idea is an element that, when clicked, changes the state of the application, maybe it is better to have a button or a link.
– Pablo Almeida