View Full Version : Required Fields and Correct Email Add.

02-20-2003, 05:02 PM
I think im gonna abuse my newbiness...:p

Besides, Im kinda in a hurry to get this over with.. so i dont have much time or energy to "play" around with it anymore..so...

Here's the thing I have two scripts one validates that all required fields - name, email, tel.nos..etc. are accomplished before it gets Submitted (via poprompt)...the other one, makes sure that the email address is correctly typed in..as with the @ sign and domain are in order...

I've combined the two into one script (all fields are required), please see attached..but I can only make one work...how can i properly combine the two? Right now with the attached text script..it validates ONLY that Required fields are complete...
I almost got it to work validating required fields and that a valid email is entered...but then...it only validated until the email add. w/o validating the rest of the fields, it accepted it when i hit submit

The "perfect" sequence would be...first check that the Name field is filled up, and then check that a valid email address has been put in...(coz i dont want to have them put in a bogus email from the start..even if they've completed the other fields b4 submission...although, i could probably live with having them to go back and check the email field again....


Philip M
02-20-2003, 07:51 PM
The function checkemail() is not called anywhere so is not executed.

<input type="text" name="requiredemail" size="25" MAXLENGTH="25" style="BACKGROUND-COLOR: rgb(0,0,0); COLOR: rgb(255,255,0); onBlur="checkemail(this)">

02-20-2003, 08:52 PM
I think you're on to something there...but when I applied what you had suggested...didnt work.

I think that function checkemail() is part of another javascript function...dunno what its called (im pretty darn new at this
...sub-function:confused: ...of this:

function checkbae(){
if (document.layers||document.getElementById||document.all)
return checkemail()
return true

So i think there's a sequence that needs to be followed coz there are actually 3 "validating" scripts on this one...have to find the right combination and/or sequence...i think one is redundant...dunno...any more ideas?