We help IT Professionals succeed at work.

Seeking javascript that unchecks all other checkboxes in a form when "none of the above" is checked

egoselfaxis
egoselfaxis asked
on
I'm looking for a small re-usable snippet of javascript that unchecks all of the other checkboxes in a form when the checkbox that has a value of "None of the above" is checked.  

I'm using jQuery, .. but the solution doesn't have to require it.

Thanks,
- Yvan
Comment
Watch Question

Senior .Net Developer
Commented:
add a class to the other checkboxes:

 $('input:checkbox.CLASS').removeAttr('checked');

Author

Commented:
Actually .. your function didn't work in my jQuery mobile environment.  This function works, however:

$(":checkbox.notnone").prop("checked", false).checkboxradio("refresh");

Thanks though - you steered me in the right direction.

- Yvan