Skip to content

Instantly share code, notes, and snippets.

@codearmorygists
Created September 19, 2012 22:46
Show Gist options
  • Save codearmorygists/3752830 to your computer and use it in GitHub Desktop.
Save codearmorygists/3752830 to your computer and use it in GitHub Desktop.
Check/uncheck all checkboxes in a form
function checkAll() {
var theForm, z = 0;
theForm = form_1;
for(z=0; z<theForm.length;z++){
if(theForm[z].type == 'checkbox'){
theForm[z].checked = true;
}
}
}
function uncheckAll() {
var theForm, z = 0;
theForm = form_1;
for(z=0; z<theForm.length;z++){
if(theForm[z].type == 'checkbox'){
theForm[z].checked = false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment