Here is a function that counts selected checkboxes.
Call it with checkSelection(yourform, 'foo');
function checkSelection(formname, fieldname){
var form = document.getElementById(formname);
var selectedCounter=0;
for (var i=0;i<form.length;i++){
fldObj = form.elements[i];
if (fldObj.type=='checkbox'){
if ( fldObj.name.indexOf(fieldname)>0){
if (fldObj.checked==true) {
selectedCounter++;
}
}
}
}
Perhaps this helps.
Michael
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Dienstag, 18. Juli 2006 20:41
To: MyFaces Discussion
Subject: need javascript syntax to loop through checkbox list from
dataTable
hello to everyone
I'm using a tomahawk dataTable where one of the t:columns contains a
t:selectBooleanCheckbox
The tag has id and a forceId="true" attributes.
In the rendered html, the id of the checkbox is foo[0], foo[1] etc
I need to be able to loop through this list and look for a .checked
property.
I've tried all the loop mechanisms usually described for checkboxes but
can't hit on the proper
javascript syntax. googled till my eyes glazed over.
can someone provide an example or a good reference to resolve this?
Thanks in advance for your time and help.
Tom
This message is intended for the recipient only and is not meant to be
forwarded or distributed in any other format. This communication is for
informational purposes only. It is not intended as an offer or
solicitation for the purchase or sale of any financial instrument, or
security, or as an official confirmation of any transaction. Putnam
does not accept purchase or redemptions of securities, instructions, or
authorizations that are sent via e-mail. All market prices, data and
other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made
herein do not necessarily reflect those of Putnam, LLC (DBA Putnam
Investments) and its subsidiaries and affiliates. If you are not the
intended recipient of this e-mail, please delete the e-mail.