Solved

form checking input email and number values in flash

Posted on 2006-07-14
2
194 Views
Last Modified: 2010-04-03
Hi experts,

As title I would like to know how to check in flash:

1) a text field 'phone' is number or not
2) a text field 'email' has the correct email format or not (with the @ and '.')

Thanks~!
0
Comment
Question by:huang_ck
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
furmiga earned 500 total points
ID: 17113367
Hi there!


Answering n.1 - If you want just numbers in your phone text field then just select the range of the characters allowed to be typed in the field. (In the imput text properties, you will find a button named "characters...", hit "Specify Ranges" and then click "Numerals[0..9]..." then hit OK.

Answering n.2 - This is a bit more complicated. You can set any verifications but still you can't prevent from a wrong imput.

on(release) // simple button action
{
    if((email.text.indexOf("@") == -1) or (email.text.charAt(0) == ".") or (email.text.charAt(0) == "@") or (email.text.indexOf(".") == -1))
    {
        trace("Wrong email format.")
    }
}

Here the email field can't start with "." or with"@" and must have both along the string. This is enuf to make you imput an correct email format. Again, this won't prevent users from type "damn_email@verification.com" with im pretty sure doesn't exist :)

Thats it. Anything just gimme a call


Ralph
0
 

Author Comment

by:huang_ck
ID: 17123081
cool thanks~!
0

Featured Post

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question