Click to See Complete Forum and Search --> : radio/checkbox validate


tripwater
03-26-2003, 10:38 AM
I have a group of 3 radio buttons that allow the user to pick how long to subscribe. 1st radio is free 30 day trial.

On this page I collect the user's contact info.
So I have a check box also that if the user has the same billto address to check it so they do not have to re-enter it on the next page.

What I would like to do is if they clicked the 30 day free trial and accidentally check the "same as" checkbox for the billing to alert them that this is not necessary as you do not need a billto for a free trial.

So in a nutshell I only need to make sure that if both my 30 day radio button is checked as well as my same as check box, then alert them. Thank you ahead of time.

My form name =acctsetup
3 radio names = accttype
1 checkbox name = billinfosame

SeGamysa
03-26-2003, 10:54 AM
I guss if they're all the same
the first 3 lines should be on one line of code
If(document.formname.radioButtonname.value == Trial &&
document.formname.radioButtonname2.value == sameAdress)
{
alert ("you don't need that radio button checked");
}
Is this what you need?

tripwater
03-26-2003, 10:58 AM
sorry ... let me clarify.

radio1 = 30 day trial
radio2 = 1 yr pay
radio3 = 2 yr pay

checkbox = billto same as shipto

if radio1 is checked as well as checkbox then alert because they do not need a billto for a free trial.

thanks.

tripwater
03-26-2003, 11:26 AM
I figured it out. Thanks.