We have a page that has Select/Deselect All buttons to
check/uncheck all the checkboxes in the form. The checkboxes are
dynamically named:
<cfoutput query="qHoldAdj">
<cfinput type="checkbox"
name="select_#qHoldAdj.CURRENTROW#">
</cfoutput>
There are also other field types in this form, so currently
this is the JS we have to select all the checkboxes:
function selectAll()
{
var objForm=document.forms.validateAdj;
var m=objForm.length;
for (var i=0; i<m; i++){
var e=objForm.elements
;
if (e.type=='checkbox' && e.name!='approve'){
e.checked=true;
}
}
}
With 6 form fields per line, when we spit out over 100 rows a
page, firing off this JS freezes the page for a bit while it runs
through every single form field, decides if its a cb or not, then
checks it if it is. Ugh!
What would be nice if we could reference the checkboxes by
name, eliminate 80% of the work per row. Problem is the names are
dynamic and referencing them in JS is a headache we haven't figured
out how to cure yet.
Anybody have an idea of how to do this...?