I did this and it still doesn't work.
It must be related to the scripts created
by ColdFusion for the CFForms.

----- Original Message -----
From: "Bob Silverberg" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, October 24, 2000 12:09 PM
Subject: RE: Problem with email form validation


> Firstly, you should have your CheckEmail function return false if the
> validation fails - it looks like you haven't specified that within the
> function.
>
> Then, in your <form> tag, call the function by doing:
>
> onSubmit="return CheckEmail();"
>
> Bob
>
> -----Original Message-----
> From: Michael Gagnon [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 24, 2000 10:51 AM
> To: CF-Talk
> Subject: Problem with email form validation
>
>
> Hi!
>
> I was wondering if there was a way arond this problem.
>
> I am using the CFINPUT 's "Required" and "Message"
> options.  They work great, except that I want to
> go further with the email verification.
> I inserted a script to verify the format of the
> email address.  The problem is that if all the
> fields are correct except for the email format, this scripts
> correctly tells me that the email is not in a proper format,
> but after I click on OK, the form is sent anyways.
>
> Here is one of the scripts I tried:
>
> <script language="JavaScript">
>   function ValidEmail(item) {
>    var lsAT;
>    var lsDOT;
>
>    lsAT = item.value.indexOf("@");
>    lsDOT = item.value.indexOf(".");
>
>    if (lsAT == -1 || lsDOT == -1 || item.value.indexOf(" ") != -1 || lsAT
+
> 1 >= lsDOT ) {
>     return false;
>    }
>    return true;
>   }
>
>   function CheckEmail() {
>    if(!ValidEmail(document.EmailForm.Email)) {
>    alert("<cfoutput>#data.a73#</cfoutput>");
>    }
>    return true;
>   }
>
>  </script>
>
>
> Any help would greatly be apreciated.
> TIA!
> _____________________
> Michael
>
> --------------------------------------------------------------------------
--
> --------------------
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send
a
> message with 'unsubscribe' in the body to
[EMAIL PROTECTED]
>
> --------------------------------------------------------------------------
----------------------
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send
a message with 'unsubscribe' in the body to
[EMAIL PROTECTED]

------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to