C
cerr
Hi There,
I have a bunch of radio groups on a page and would like to uncheck
them all together on button click.
OnClick I trigger this function:
function uncheck(grpnr){
group="grp"+grpnr;
alert("hello!"+"\r\n"+group+"\r\n");
if (document.getElementByName(group)){
alert("Got it!");
}
for (var i=0; i<document.toppings.group.length; i++) {
document.toppings.group.checked = false;
}
}
The radio groups is called "grp4" (with the number incrementing). So i
pass the index number to this function, assemble the group name but
for some reason this doesn't seem to work, any clues what i need to do
differently? I also never get the "Got it!" message...my form tag
looks like this:
<form name="toppings" action="/store/index.php" method="POST">
Thank you for the help!
I have a bunch of radio groups on a page and would like to uncheck
them all together on button click.
OnClick I trigger this function:
function uncheck(grpnr){
group="grp"+grpnr;
alert("hello!"+"\r\n"+group+"\r\n");
if (document.getElementByName(group)){
alert("Got it!");
}
for (var i=0; i<document.toppings.group.length; i++) {
document.toppings.group.checked = false;
}
}
The radio groups is called "grp4" (with the number incrementing). So i
pass the index number to this function, assemble the group name but
for some reason this doesn't seem to work, any clues what i need to do
differently? I also never get the "Got it!" message...my form tag
looks like this:
<form name="toppings" action="/store/index.php" method="POST">
Thank you for the help!