Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

form checking input email and number values in flash

Posted on 2006-07-14
2
Medium Priority
?
197 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

730 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