# Verify email address - help

**URL:** <https://forum.kirupa.com/t/verify-email-address-help/260399>\
**Category:** Uncategorized\
**Created:** [May 15, 2008, 8:43am UTC](https://forum.kirupa.com/t/verify-email-address-help/260399 "2008-05-15T08:43:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![korpela2](https://avatars.discourse-cdn.com/v4/letter/k/8e8cbc/32.png) [@korpela2](https://forum.kirupa.com/u/korpela2)\
**Post date:** [May 15, 2008, 8:43am UTC](https://forum.kirupa.com/t/verify-email-address-help/260399/1 "2008-05-15T08:43:44Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![joran420](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joran420/32/2329_2.png) [@joran420](https://forum.kirupa.com/u/joran420)\
**Post date:** [May 15, 2008, 6:37pm UTC](https://forum.kirupa.com/t/verify-email-address-help/260399/2 "2008-05-15T18:37:05Z")

</div>

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  
}

---

<div class="post-metadata">

**Author:** ![jon\_bla](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jon\_bla](https://forum.kirupa.com/u/jon_bla)\
**Post date:** [May 15, 2008, 7:06pm UTC](https://forum.kirupa.com/t/verify-email-address-help/260399/3 "2008-05-15T19:06:37Z")

</div>

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

I love it- usage is so simple too
