Avatar of mmoore500
mmoore500
 asked on

Javascript onsubmit problem

I am trying to validate a form using javascript. The the form is slightly different depending on whether or not the previous page selection is "exhibitor" or "attendee."

I have onsubmit="return validate()" and it works properly if the client chooses "attendee", but it doesn't work if the client chooses "exhibitor."
function validate()
{
	var returnVal;
	if(	(document.getElementById('MemberYes').checked==false) && (document.getElementById('MemberNo').checked==false)	)
	{
		returnVal = false;
	}
	
	return returnVal;
}

Open in new window

JavaScriptHTML

Avatar of undefined
Last Comment
mmoore500

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Umar Topia

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
neeraj523

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Kin Fat SZE

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Michel Plungjan

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
chintanpshah

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Michel Plungjan

All the same suggestions. How about we wait for the html?
chintanpshah

What do you mean by "wait for the html?"
Michel Plungjan

" works properly if the client chooses "attendee",  but it doesn't work if the client chooses "exhibitor."

seems to me we should have a look to see if the snippet posted has anything at all to do with the error.

Now we one suggestion that does not do anything differently except waste a var and 3 suggestions that all work the same but it is possible that none of them solves the issue
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
neeraj523

Hello @mmoore500

are you still looking for further assistance on this question ?
mmoore500

ASKER
Hey guys, sorry for neglecting this today. I appreciate all of the responses. I've got a tight deadline and I got this figured out earlier. I just retyped part of the function (there was more to it than I posted) and it worked. I didn't even try to figure out what was wrong (I wrote it on no sleep and just rewrote it after I got a little). It looks like 5 of you guys chipped in comments, so I'll spread the points evenly amongst you all.

Thanks again and sorry for not getting back sooner.