Posted By

sekihin on 03/09/09


Tagged

javascript checkbox


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

brent-man
jadedbat


Check all checkbox in the form


 / Published in: JavaScript
 

  1. <SCRIPT LANGUAGE="JavaScript">
  2. function checkAll() {
  3. var theForm, z = 0;
  4. theForm = form_1;
  5. for(z=0; z<theForm.length;z++){
  6. if(theForm[z].type == 'checkbox'){
  7. theForm[z].checked = true;
  8. }
  9. }
  10. }
  11.  
  12. function uncheckAll() {
  13. var theForm, z = 0;
  14. theForm = form_1;
  15. for(z=0; z<theForm.length;z++){
  16. if(theForm[z].type == 'checkbox'){
  17. theForm[z].checked = false;
  18. }
  19. }
  20. }
  21. </SCRIPT>

Report this snippet  

You need to login to post a comment.