Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Feedback on: irt.org FAQ Knowledge Base Q1118

irt.org | About | Feedback | 3511 [ previous next ]

Feedback on:
irt.org FAQ Knowledge Base Q1118

Sent by
michel on January 22, 2002 at 01:56:02:

Comments:
Using names (name="chk_something") :

function checkAll(theChk) {
var f = theChk.form;
var chk = theChk.checked;
for (i=0;i<f.elements.length;i++) {
if (f.elements[i].name.indexOf('chk_') !=-1) {
f.elements[i].checked=chk;
}
}
}

using fixed part an a number (name="chk_1" to name="chk_10"):

numberOfChks = 10;
function checkAll(theChk) {
var f = theChk.form;
var chk = theChk.checked;
for (i=1;i<=numberOfChks;i++) {
f.elements["chk_"+i].checked=chk;
}
}

<input type="checkbox" name="allChecker" onClick="checkAll(this)">Select all



Other feedback on 'irt.org FAQ Knowledge Base Q1118' - show all


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 21st December 2007. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.