[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

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");
}


0
tariez
Asked:
tariez
  • 2
  • 2
  • 2
1 Solution
 
CyanBlueCommented:
Howdy...  :)

You could try this...  :)

on (press)
{
      trace("Email = " + Email);
      trace("Email.indexOf(\"@\") = " + Email.indexOf("@"));
      
      if (Email.indexOf("@") < 0)
      {
            Status = "please enter a valid email address";
      }
      else
      {
            _root.gotoAndPlay("submit");
      }
}
0
 
tariezAuthor Commented:
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"?


0
 
CyanBlueCommented:
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'...  ;)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
sokhodomCommented:
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,
0
 
tariezAuthor Commented:
Hi yup got my answers. thanks!

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

0
 
sokhodomCommented:
no problem m8 :)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now