Posted By

krisdb on 04/13/07


Tagged

javascript


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


toggleCheckboxes


 / Published in: JavaScript
 

  1. //unchecks all checkboxes
  2. function toggleCheck(field) {
  3. if (!(field.length)) {
  4. field.checked = (field.checked == false) ? true : false;
  5. }
  6. else {
  7. for (var i = 0; i < field.length; i++) {
  8. field[i].checked = (field[i].checked == false) ? true : false;
  9. }
  10. }
  11. }

Report this snippet  

You need to login to post a comment.