Set all Checkbox values to Checked

var chks=document.getElementsByName("#{id:fldName}");
for(var i=0;i<chks.length;i++){
 chks[i].checked = true;

Some simple code to set all the checkbox values of a checkbox group to checked.  Useful behind a [Select All] button
where "fldName" is the name of the CheckBoxGroup

JavaScript (Client)
Martin Rolph
June 23, 2012 1:02 PM

All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.

No comments yetLogin first to comment...