S
Seeker
Newbie question here...
I have a form with some radio buttons. To verify that at least one of the
buttons was chosen I use the following code ("f" is my form object) :
var btnChosen;
for (count = 0; count <= 1; count++) {
if (eval(f.RadioButtons[count].checked)) {
btnChosen = true;
}
}
if (!btnChosen) { /* Code here to warn no button selected */}
....I'd like to move this to a function. Can I pass the "f.RadionButtons"
array to a function in Javascript? This way I could simply say:
if (! fncSelected(f.RadioButtons)) { /* Code here to warn no button selected
*/}
I have a form with some radio buttons. To verify that at least one of the
buttons was chosen I use the following code ("f" is my form object) :
var btnChosen;
for (count = 0; count <= 1; count++) {
if (eval(f.RadioButtons[count].checked)) {
btnChosen = true;
}
}
if (!btnChosen) { /* Code here to warn no button selected */}
....I'd like to move this to a function. Can I pass the "f.RadionButtons"
array to a function in Javascript? This way I could simply say:
if (! fncSelected(f.RadioButtons)) { /* Code here to warn no button selected
*/}