|
-
Sep 30th, 2001, 07:48 PM
#1
check all checkboxes...
Can somebody show me how to check all checkboxes in a form with JavaScript? Like in Hotmail, you've got that "Check All" checkbox at the top of the Inbox.
Thanks
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Sep 30th, 2001, 07:53 PM
#2
Member
From our very own John Percival :
Code:
function CheckAll() {
for (var i=0;i<document.form.elements.length;i++) {
var e = document.form.elements[i];
if ((e.name != 'allbox') && (e.type=='checkbox')) {
e.checked = document.form.allbox.checked;
}
}
}
Of course you have to name your INPUT fields appropriately.
-
Sep 30th, 2001, 08:03 PM
#3
Thanks Arien, I take back all but 4 bad things I've said about you. (I need to keep some in reserve )
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Sep 30th, 2001, 08:04 PM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|