Link to home
Start Free TrialLog in
Avatar of tariez
tariez

asked on

Check if Email is valid (check for @ symbol) in flash's email input box

Hi

i have a email input box in my flash form. How can i check for the @ sign in this input box before i allow the user to submit?

right now i cant figure how to write this....of coz this doesnt work but can anyone tell me how should i write this?
on (press)
{
if (Email != "@")
 { Status = "please enter a valid email address";
 } else {
     _root.gotoAndPlay ("submit");
}


ASKER CERTIFIED SOLUTION
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tariez
tariez

ASKER

Hi yah it works! thanks

i am looking at some flash dictionary, but wonder if u can help me abit more here,  wat's "indexOf"?


Basically indexOf() function looks for the specified character, @ in this case, and returns the location of that character if found, and returns -1 if @ is not found...  That's what I am checking with '< 0'...  ;)
tariez,

It's late here. but here is a link to the flash email validtion: http://www.cambodiaxp.com/tutorial/flash-advance/email-validator/email-validation.php

Cheers,
Avatar of tariez

ASKER

Hi yup got my answers. thanks!

and sokhodom. yup that url was helpful too. thanks!

no problem m8 :)