Connecting Tech Pros Worldwide Forums | Help | Site Map

Iterate all object of a specific name

Man-wai Chang
Guest
 
Posts: n/a
#1: May 16 '07

Is there a more elegant solution than this?

function checkUncheckAll(theElement) {
var theForm = theElement.form, z = 0;
for (z=0; z<theForm.length;z++) {
if (theForm[z].type == 'checkbox' && theForm[z].name != 'checkall') {
var lnIndex=theForm[z].name.substr(6,theForm[z].name.length-1);
if (document.getElementById("txtStatus"+lnIndex).valu e=="D") {
if (theElement.checked==true) {
theForm[z].checked=confirm(....);
}
} else {
theForm[z].checked=theElement.checked;
}
}
}
}


--
iTech Consulting Services Limited
Expert in ePOS (Point-Of-Sales) solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852)2325 3883 Fax: (852)2325 8288

Randy Webb
Guest
 
Posts: n/a
#2: May 17 '07

re: Iterate all object of a specific name


Man-wai Chang said the following on 5/15/2007 11:05 PM:
Quote:
Expert in ePOS (Point-Of-Sales) solutions
Website: http://www.itech.com.hk (IE only)
How can one be an ePOS "Expert" if they can't create a cross-browser
website?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Man-wai Chang
Guest
 
Posts: n/a
#3: May 17 '07

re: Iterate all object of a specific name


How can one be an ePOS "Expert" if they can't create a cross-browser
Quote:
website?
That line is an ad. Let's go back to javascript.

You went off-topic in my opinion.. :)

--
iTech Consulting Services Limited
Expert in ePOS (Point-Of-Sales) solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852)2325 3883 Fax: (852)2325 8288
Closed Thread