Click to See Complete Forum and Search --> : two form validations


pucepuce
12-13-2003, 01:06 PM
I have two form validations in my onSubmit=""

Why does only the first one (return checkrequired) work?

I separated them with a semicolon, isn't that the correct way to do it?

<form method="post" action="/cgi-bin/mailer.pl" onSubmit="return checkrequired(this);return checkEmail(this)">

http://www.sanddiving.com/Contactus.htm

Thank you for your help,
Nicole

ray326
12-13-2003, 02:16 PM
Because of the "return". You need to make a wrapper function that calls (or does) all the validation for that form and returns the result once. If that's all you're checking I suppose you could just:

onsubmit="return(checkrequired(this) && checkEmail(this))"

pucepuce
12-15-2003, 05:46 PM
Thank you so much for helping me out here. Now I can finally finish my project; thanks to you! Needless to say that it worked!