idiotbear
07-08-2003, 06:48 AM
hey guys
I have an ASP page which displays a recordset - each record in the rs has a dynamically named checkbox (ie. <%="InvoiceRun_" & rs.RecordID%>. It all works fine, except I have a little JS function that used to check all my checkboxes, back when my checkboxes were statically named:
function checkall(formname,checkname,thestate){
var el_collection=eval("document.forms."+formname+"."+checkname)
for (c=0;c<el_collection.length;c++)
el_collection[c].checked=thestate
}
I used to call this function like so:
<a href="javascript:checkall('approve', 'InvoiceRun',true)">Tick All</a>
What I'd like to know is whether anyone has any clue how to get it to check all the boxes now that they're not all called "InvoiceRun". They all still START with "InvoiceRun", but end in the recordID. Some kind of wildcard would be good, only my javascript doesn't run to that....
Cheers
R
I have an ASP page which displays a recordset - each record in the rs has a dynamically named checkbox (ie. <%="InvoiceRun_" & rs.RecordID%>. It all works fine, except I have a little JS function that used to check all my checkboxes, back when my checkboxes were statically named:
function checkall(formname,checkname,thestate){
var el_collection=eval("document.forms."+formname+"."+checkname)
for (c=0;c<el_collection.length;c++)
el_collection[c].checked=thestate
}
I used to call this function like so:
<a href="javascript:checkall('approve', 'InvoiceRun',true)">Tick All</a>
What I'd like to know is whether anyone has any clue how to get it to check all the boxes now that they're not all called "InvoiceRun". They all still START with "InvoiceRun", but end in the recordID. Some kind of wildcard would be good, only my javascript doesn't run to that....
Cheers
R