Forum Moderators: open
i have a page where the user can select multiple attributes for products, there is a checkbox in front of every attribute from where he can select multiple checkboxes. i want to give an option to user like
- (checkbox) Check All Options
- (checkbox) UnCheck All Options
Please help me in this.
thanks in advance
function check_all_boxes (booboo) {
for(var i=1;i<0 + 1;i++){
var blockindex = "box-" + i;
booboo.form[blockindex].checked = true;
}
return false;
}
should check them all. TO uncheck them all, make "true" be "false."
Then in your form, you have something like
<input type=button onclick="check_all_boxes(this);" value="check all">
At least, that's how I've always done it. I'm sure there must be a better way, but that seems to work.
JK