RE: javascript -check all
but i ahve a jsp using struts that has a table with rows.each row has a check box.I have a checkbox at the top of the table, clicking which, i want all below checkboxes to be checked..has anyone implemented this code.. I have a javascript library which makes this functionality very easy to implement: http://www.mattkruse.com/javascript/checkboxgroup/ Hope that helps, Matt
Re: javascript -check all
function checkAll() { for ( var i=0; idocument.forms[0].elements.length; i++ ) { if ( document.forms[0].elements[i].type == checkbox ) { document.forms[0].elements[i].checked=true ; } } return false; } aa Hi aa Probably slightly off topic aa but i ahve a jsp using struts that has a table with rows.each row has a check box.I have a checkbox at the top of the table, clicking which, i want all below checkboxes to be checked..has anyone aa implemented this code.. aa Thanks much in advance, aa sam aa - aa Do you Yahoo!? aa Yahoo! Tax Center - File online by April 15th -- Best regards, Andreymailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: javascript -check all
function checkAll(formName,field) { var formtest = document. + formName +.+field; var formObj= eval(document. + formName +.+field); var length = formObj.length; if(length 1){ for (i = 0; i length ; i++) formObj[i].checked = true ; } else{ formObj.checked = true ; } } u can use the above javascript function where form is the name of ur html form and filed is the name of ur chexbox On Sat, 17 Apr 2004 as as wrote : Hi Probably slightly off topic but i ahve a jsp using struts that has a table with rows.each row has a check box.I have a checkbox at the top of the table, clicking which, i want all below checkboxes to be checked..has anyone implemented this code.. Thanks much in advance, sam - Do you Yahoo!? Yahoo! Tax Center - File online by April 15th