Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <SCRIPT LANGUAGE="JavaScript">
  2. function CheckAll(chk){
  3. for (i = 0; i < chk.length; i++)
  4. chk[i].checked = true ;
  5. }
  6.  
  7. function UnCheckAll(chk){
  8. for (i = 0; i < chk.length; i++)
  9. chk[i].checked = false ;
  10. }
  11. </script>
  12.  
  13. <form name="test" action="/">
  14. <input name="category[]" type="checkbox" value="a">a
  15. <input name="category[]" type="checkbox" value="b">b
  16. <input name="category[]" type="checkbox" value="c">c
  17. <input name="category[]" type="checkbox" value="e">d
  18.  
  19. <input name="CheckAll" type="button" value="Select All"
  20. onclick="CheckAll(document.test['category[]'])" />
  21. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement