Return to Snippet

Revision: 3805
at September 14, 2007 20:55 by scriptmakingcom


Initial Code
function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
}

Initial URL
http://www.somacon.com/p117.php

Initial Description

                                

Initial Title
Check or Uncheck all checkboxes on a form

Initial Tags
javascript

Initial Language
JavaScript