Verify email address - help

Hi all,

Im trying to create a form in actiocsript that verifies correct user input before submitting. So far I have the form checking that NewEmail contains characters, an “@” symbol and a “.” symbol.

However is there code that can check that the layout of the email is correct before submitting i.e. <“sometext”@“sometext”.“sometext”>

Also I need to insert a seperate name verifier to check that there are no numbers included in a text box.

This is my code so far:

_global.detailsCheck = function() {
if ( _root.NewEmail.length == 0 | _root.NewEmail.length == “” | _root.NewEmail eq “”) {
// Alerts the user that their password is incorrect
_root.Guide2 = “Please Fill All Detail Fields”;
// Stops the movie from going to the next frame
stop();
} else if (_root.NewEmail.indexOf("@") == -1) {
_root.Guide2 = “Please Give A Valid Email Address”;
stop();
} else if (_root.NewEmail.indexOf(".") == -1) {
_root.Guide2 = “Please Give A Valid Email Address”;
stop();
} else {
//submit details
gotoAndPlay (“ExitFrame”);
}
}

Any help would be much appreciated…

why not just disalow userinput of numbers
textField.restrict =“0-9"
should work
var idx1 = _root.NewEmail.indexOf(”@")
var idx2 = _root.NewEmail.lastIndexOf(".")
if(idx1>-1 && idx2>idx1){
//email is properly formed
}

I use this class
http://proto.layer51.com/d.aspx?f=1443

I love it- usage is so simple too