thanks. how do you name your checkboxes in a form

N

NotGiven

Thanks Erwin. I also found this brilliant function at
(http://www.breakingpar.com/bkp/home.nsf/Doc!OpenNavigator&CA99375CC06FB5268
7256AFB0013E5E9)

However, do you have to call your checkboxes all the same field name for
this to work?

function getSelectedCheckbox(buttonGroup) {
// Go through all the check boxes. return an array of all the ones
// that are selected (their position numbers). if no boxes were checked,
// returned array will be empty (length will be zero)
var retArr = new Array();
var lastElement = 0;
if (buttonGroup[0]) { // if the button group is an array (one check box
is not an array)
for (var i=0; i<buttonGroup.length; i++) {
if (buttonGroup.checked) {
retArr.length = lastElement;
retArr[lastElement] = i;
lastElement++;
}
}
} else { // There is only one check box (it's not an array)
if (buttonGroup.checked) { // if the one check box is checked
retArr.length = lastElement;
retArr[lastElement] = 0; // return zero as the only array value
}
}
return retArr;
} // Ends the "getSelectedCheckbox" function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top