I got a much simpler one:

Check for invalidity:

// ti = text input field
if((ti.text.indexOf("@") == -1) || (ti.text.indexOf(".",(ti.text.indexOf("@")+2)) == -1) ) {
        // email is invalid
}

OR...

Check for validity:

// ti = text input field
if((ti.text.indexOf("@") != -1) && (ti.text.indexOf(".",(ti.text.indexOf("@")+2)) != -1) ) {
        // email is valid
}

__________________________________________________________

Joseph Balderson, Flash Platform Developer
http://www.joeflash.ca | 416-768-0987
Writing partner, Community MX | http://www.communitymx.com
Consultant, New Toronto Group | http://www.newyyz.com

Rich Rodecker wrote:
I found this when I was adding stuff to actionscriptclasses.com :

http://www.robgonda.com/blog/index.cfm/2006/3/1/actionscript-regular-expression-class

the download has an email validation example.



On 11/17/06, Steven Sacks | BLITZ <[EMAIL PROTECTED]> wrote:

> However it seems to think an email address with less that 4
> characters before the "@' is not valid (when it is).

So just modify it to allow less than 4 characters before the @.
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to