Created
October 11, 2012 10:46
-
-
Save gabrielstuff/3871583 to your computer and use it in GitHub Desktop.
Invite all friends
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } | |
| //To use | |
| SetAllCheckBoxes('uq9y9m223', 'checkableitems[]', true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment