[ic] Valid Email Checking
mark at americanmicroinc.com
Thu Nov 18 12:58:16 EST 2004
>>Is there a way to check a "value" for being a valid email address *without*
>>using a form profile?
> would think you could get creative with an mv_click or mv_check too.
The following solution is untested, but should work. If you find that
the "onBlur" event handler doesn't quite work out for you, try using an
"onChange" event handler or another event handler that is more to your
needs. The function is checking to see if the value in the email field
contains the "@" symbol, and does not actually generate a message sent
to the email address to test whether or not the address is functional.
It merely checks to see if the address is formatted in a valid fashion.
Example: mickey2mouse at disney300world.com is in a valid email address
format, but it likely would get bounced if one tried to send something
to this address.
Also, you may find that you will have to adjust the regex in order for
it to work correctly according to your needs.
if ( fieldvalue !~ /[A-Z,a-z,0-9]\@[a-z,0-9]\.[a-z]/ )
alert("This field must contain a valid email address.\nPlease
check the value you entered and correct if necessary.");
elsif ( fieldvalue == "" )
alert("This field cannot be left blank.\nPlease enter a valid
<input onBlur="check_email(this.value)" TYPE=text NAME=email VALUE=""
American Micro Industries, Inc.
Webmaster/Database Systems Administrator
Remember: Amateurs built the Ark, Professionals built the Titanic
More information about the interchange-users