# How to check this

**URL:** <https://forum.kirupa.com/t/how-to-check-this/18610>\
**Category:** flash\
**Created:** [April 18, 2003, 4:38pm UTC](https://forum.kirupa.com/t/how-to-check-this/18610 "2003-04-18T16:38:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kingsleyho](https://avatars.discourse-cdn.com/v4/letter/k/ecccb3/32.png) [@Kingsleyho](https://forum.kirupa.com/u/Kingsleyho)\
**Post date:** [April 18, 2003, 4:38pm UTC](https://forum.kirupa.com/t/how-to-check-this/18610/1 "2003-04-18T16:38:26Z")

</div>

How to check whether the visitors’s input of e-mail address is correcet or not and give a msg to the visiotr that the input is invalid.same as [http://www.2advanced.com/](http://www.2advanced.com/)  
please help

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 18, 2003, 6:04pm UTC](https://forum.kirupa.com/t/how-to-check-this/18610/2 "2003-04-18T18:04:42Z")

</div>

[AS]/_#####################################_/  
/\* Email - Check | Flash MX | 2002 _/  
/_ Sebastian Wichmann _/  
/_ Michael Holl (Holly) _/  
/_[http://www.flashhilfe.de](http://www.flashhilfe.de)_/  
/_#####################################\*/

// Email darf nur die folgenden Zeichen enthalten  
email\_instanz.restrict = “a-zA-Z0-9@.\_-”;

function email\_check() {  
if (email.length) {  
inhalt = email.split("@");  
domain = inhalt[1].split(".");  
laenge = domain.length;  
return inhalt.length == 2 && inhalt[0].length \>= 1 && laenge \>= 2 && domain[laenge-2].length \>= 3 && domain[laenge-1].length \<= 4 && domain[laenge-1].length \>= 2 && domain.join().indexOf("\_") == -1 ? true : false;  
}  
return false;  
}

// Usage: Button (Textfeld =\> Vari.: email, Instanz.: email\_instanz)  
on (release) {  
email\_check(\_root.email) ? trace(“Email is OK!”) : trace(“Email wrong!”);  
} [/AS]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 11:47am UTC](https://forum.kirupa.com/t/how-to-check-this/18610/3 "2003-04-19T11:47:44Z")

</div>

Can u explain in details ?  
where should i put those scripts in ?  
flash or PHP ?  
thanks a lot

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 12:33pm UTC](https://forum.kirupa.com/t/how-to-check-this/18610/4 "2003-04-19T12:33:58Z")

</div>

that’s actionscript, so use in flash;

1.“email\_instanz” replace by the instance name of the textfield where email is entered; restrict allows only certain chars/disallows others; script in main timeline keyframe

1. "function email\_check() " is, as the name says, the function called to perform the validation, put in same keyframe as above.  
will return true or false

3.“on (release)” on the submit button (to make things simple, in mx should be in keyframe again, never mind…)  
-replace “\_root.email” by path & instance of your email input textfield  
-replace “trace” actions by what you want to happen in each case…

try, **if it doesn’t work** , i’ll look at your fla

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 12:35pm UTC](https://forum.kirupa.com/t/how-to-check-this/18610/5 "2003-04-19T12:35:05Z")

</div>

ps : or did you want one for php?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 2:40pm UTC](https://forum.kirupa.com/t/how-to-check-this/18610/6 "2003-04-19T14:40:44Z")

</div>

oh i understand now  
but how can i show the output such as “email is ok” to the user?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 2:42pm UTC](https://forum.kirupa.com/t/how-to-check-this/18610/7 "2003-04-19T14:42:26Z")

</div>

and i also want to know that how can i check whether the input is a number or not.Thank you very much

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 5:13pm UTC](https://forum.kirupa.com/t/how-to-check-this/18610/8 "2003-04-19T17:13:20Z")

</div>

are u there eyezberg?  
please help  
thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 5:33pm UTC](https://forum.kirupa.com/t/how-to-check-this/18610/9 "2003-04-19T17:33:08Z")

</div>

1. “how can i show the output such as “email is ok” to the user?”  
in “email\_check(\_root.email) ? trace(“Email is OK!”) : trace(“Email wrong!”);” replace the traces by: ?feedbacktextfield.text = “Mail ok” : feedbacktextfield.text = “Mail not valid!”  
(the function returns true or false, if true you get the 1st message, else the 2nd
2. check this:  
[http://64.207.155.38/forums/showthread.php?s=&threadid=20960](http://64.207.155.38/forums/showthread.php?s=&threadid=20960)  
(restrict as used there will allow only numbers)

make a fla, post it, i’ll take a look and fix it if needed, but try for yourself first! that’s how you learn, little by little getting to know how the different actions work…
