Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback on: irt.org FAQ Knowledge Base Q1118, January 22, 2002 at 01:56:02:

You are here: 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

©2018 Martin Webb