This content has been marked as final.
Show 3 replies
-
1. Re: Is it possible to validate an e-mail or a number.
kglad Mar 30, 2008 3:40 PM (in response to INVT)with all those typos, you should copy and paste some else's code. as3 supports regular expressions so you can use, for example, php email validation code that you convert to as3.
phone numbers are more tricky depending upon what part of the world, if any, you want to include. but you can also lift someone else's regexp code. -
2. Re: Is it possible to validate an e-mail or a number.
INVT Mar 30, 2008 11:01 PM (in response to kglad)quote:
Originally posted by: kglad
with all those typos, you should copy and paste some else's code. as3 supports regular expressions so you can use, for example, php email validation code that you convert to as3.
phone numbers are more tricky depending upon what part of the world, if any, you want to include. but you can also lift someone else's regexp code.
Sorry about the typos. 4 am and no sleep what can I say. The code is from a tutorial and I went through it 5 times before I got it right but I am still learning:).
I was interested though about using PHP code to convert to AS3. I work with a programmer who is really good at PHP so this will come in very handy. Ild like to get him soem resources about this technique PHP to AS3 any links or threads you can recomend would be appreciated.
By the way I remade the form using DW validation spry components works well and it did the job. I don't think I want to get that technical with phone # prefexes. I guess what I'm looking for is the same way the DW spry components just checks that it is a number and make sure there are for instance 10 digits.
Anyway thanks for that information works for me.
INVT
-
3. Re: Is it possible to validate an e-mail or a number.
kglad Mar 31, 2008 3:21 PM (in response to INVT)if you want to check for a u.s. phone number, you can use the flash string methods to strip extraneous characters and then check string length for 10 characters and then use the Number() function and isNaN() function to see if your 10 characters can resolve to a number.


