Phone Number Validation
Howdy...
I need some help on validating the right form of the phone number...
I have most of the aspects validated and I got into some problems that I cannot solve myself...
1. I am using textfield.restrict = "0-9-"; to restrict the alphabetic characters entered to the text field, and it works fine when I publish the HTML and check it on the web. However, I cannot use any keys like Backspace or Delete keys to erase character within the Flash... Any way I can achieve both???
2. The final format of the phone number will be '123-456-7890'. I have a onEnterFrame handler that checks if the current character length is 3 or 7 to add '-' so that the user do not need to press '-' key... It works fine when I enter the number one by one, but, say, if I hold the '1' longer to get '111-111-1111', I get '111111111111' because it just took the advantage of onEnterFrame handler... Any help on this anybody???
I have attached the FLA file in case you need to take a look...
Thank you for your time...
FlashKit > Flash Help > Flash ActionScript
Posted on: 10-26-2002, 11:35 PM
View Complete Forum Thread with Replies
Sponsored Links:
Help With Form Validation, Phone Number
here is a code below, would anyone help me validate a valid phone number? something like 555-555-5555, or numbers, or anything? right now i have it validate for empty space but little more specific would be nice, thank
__________________________________________________ _______________
fscommand ("allowscale", "false");
fname1.tabIndex = 1;
lname1.tabIndex = 2;
telno1.tabIndex = 3;
email1.tabIndex = 4;
address1.tabIndex = 5;
city1.tabIndex = 6;
state1.tabIndex = 7;
zip1.tabIndex = 8;
pdate1.tabIndex = 9;
ptime1.tabIndex = 10;
ftime1.tabIndex = 11;
passengers1.tabIndex = 12;
comments1.tabIndex = 13;
mailform = "mailform.php";
confirm = "please wait for confirmation ..."
action = "send";
Selection.setFocus("fname");
function validate (address) {
if (address.length>=7) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.lastIndexOf(".") ) {
if (address.lastIndexOf(".")<(address.length-2)) {
return (true);
}
}
}
}
return (false);
}
function formcheck () {
if ((((email == null)) || (email.length<1)) || (email == "ERROR! Address not valid")) {
email = "ERROR! Address not valid";
action = "";
}
if (!validate(email)) {
email = "Address not valid";
action = "";
}
if ((((fname == null)) || (fname.length<1)) || (fname == "ERROR! Address not valid")) {
fname = "First name required";
action = "";
}
if ((((lname == null)) || (lname.length<1)) || (lname == "ERROR! Address not valid")) {
lname = "Last name required";
action = "";
}
if ((((telno == null)) || (telno.length<1)) || (telno == "ERROR! Address not valid")) {
telno = "Phone # required";
action = "";
}
if ((validate(email)) && (email != "ERROR!") && (fname != "") && (lname != "")) {
action = "send";
loadVariablesNum (mailform, 0, "POST");
gotoAndPlay ("wait");
}
}
stop ();
__________________________________________________ _____________
View Replies !
View Related
Phone Number Validation, IndexOf
Hello,
I need some help with validating a phone number. I want to check if the length of the number is ten chars and if the first number is a "0" and the second number a "6".
This is my code so far.
Code:
form.send.onRelease = function() {
yournumber = form.number.text;
if (yournumber == null || yournumber == ""){
trace ("no number");
}
if (yournumber.length !=10|| yournumber.indexOf("0") == -1 || yournumber.indexOf("6") == -1) {
trace ("non existent number");
}
}
This only checks if there is a "0" and a "6", but not if they are the first and second char in the string.
Thanks for your help!
Jerryj.
View Replies !
View Related
Formatting A Phone Number, Round II
Hey,
i'd like to have a text field auto-format a phone number by inserting parenthesis around the area code and putting a dash between the areaCode-prefix-suffix...
I'm sure that i can create a function to do this by making conditional statements within an onChanged function, but my trouble is this.. how can i add characters to a certain index in a dynamic textbox, or is this even possible?
thanks,
-myk
the says....."mmmmMOOOOOOOOOOOOOOOOoooooooooo"
View Replies !
View Related
Backspace In Phone Number Textfield
I have a text field that when numbers are entered they format to look like a standard telephone number (XXX)XXX-XXXX using the following code.
_root.txt2.onChanged = function() {
var phonevar = this.text;
if (txt2.length == 3) {
var temp = "("+this.text+")";
this.text = temp;
Selection.setSelection(txt2.length+1, txt2.length+1);
} else if (txt2.length == 8) {
this.text += "-";
Selection.setSelection(txt2.length+1, txt2.length+1);
}
}
I'm having a problem when the user goes to backspace.. once they get to where the dash or parenthesis is inserted it won't let them delete anymore of the text.
Can anyone help me with this problem?
View Replies !
View Related
Backspace In Phone Number Textfield
I have a text field that when numbers are entered they format to look like a standard telephone number (XXX)XXX-XXXX using the following code.
_root.txt2.onChanged = function() {
var phonevar = this.text;
if (txt2.length == 3) {
var temp = "("+this.text+")";
this.text = temp;
Selection.setSelection(txt2.length+1, txt2.length+1);
} else if (txt2.length == 8) {
this.text += "-";
Selection.setSelection(txt2.length+1, txt2.length+1);
}
}
I'm having a problem when the user goes to backspace.. once they get to where the dash or parenthesis is inserted it won't let them delete anymore of the text.
Can anyone help me with this problem?
View Replies !
View Related
Explode Phone Number (Python)
Wahoo! I wrote my first python script that does something. It extracts a phone number out of a string… and divides it up into an array.
Code:
def extract_phone_number(number):
phone_number = ''
for index in range(len(number)):
if number[index].isdigit():
phone_number += number[index]
return [[phone_number.zfill(12)[-12:-10]],
[phone_number.zfill(12)[-10:-7]],
[phone_number[-7:-4]],
[phone_number[-4:None]]]
Use it like this…
Code:
extract_phone_number("512-555-3012")
extract_phone_number("11 512 555 3012")
extract_phone_number("5553012")
Anybody that knows python: Am I doing this right, or am I missing something obvious?
View Replies !
View Related
Phone
Ok, I have had help from some people for coding a phone. They helped me out, and now I have something to where you punch in your phone. That works great, I just need to come up with a design for it.
This is what I was thinking:
I want to make like a flip phone to where the phone will flip open. How could I do this. My dad is a really good artist and could draw it for me, but what should I have him draw. The starting, and ending positions?
Well, any suggestions would be helpful.
Thanks!
Michael
View Replies !
View Related
Phone Help
Is there a place I can call to talk to FLash Experts who can give me help with a problem. I'd call Adobe but I only have a trial version of Flash so I can't talk to anyone over the phone.
My problem is that the stop action on the following fla is being ignored...
www.ela1.com/testjj/index.fla
View Replies !
View Related
Phone Dialer
hey gyes plz help me out
i want do a phone diler like cellular phone
& it should dile numbers like this
"123-355-344-2345"
i.e after diling three times it should type dash(-)
so plz help me
View Replies !
View Related
Making A Phone, But............
Im trying to use a phone/keypad on as the navigation on my site. I would LOVE to be able to press the keys and see the coressponding number displayed in an LCD style box. ALSO can i do this and get the user to dial an extension to open various pages?
EG: dial 131 - numbers displayed in screen, click dial and they go to that page.
dial 136 - numbers displayed - click dial, they go to that page etc.
Can this be done? Can anyone help?
Any suggestions welome!
Yoda
View Replies !
View Related
Phone List
Hi there,
Can someone help me. I want to make a phone list that can be edited. So ppl must be able to putt in new numbers and names but must be able to delete some also.
I couldn't find any examples under the movies and i didn't found any tutorials for it eighter.
Thanks,
AmunRa
View Replies !
View Related
Phone Dialer
Hi - can anyone tell me how to create a phone dialer in flash mx?
For example 'click here to talk to us now' and the button would call 'us' and then the person calling.
Does that make sense?
View Replies !
View Related
Phone Formatter
Does anybody have idea how to make something like www.sprintvrs.com/ 's text input box (under dial area) where it automatically formats like this (###) ###-#### and adds ext on its own if needed. As well as changing letters to numbers instead.
Thanks in advance-
Bryce
View Replies !
View Related
Phone Formatting
I want to format a phone numer based on a RegEx pattern.
I got a sample code but that is a VB Script.
How can I use the same logic (given below) in ActionScript3.0.
'Create a regular expression object
Dim re
Set re = New RegExp
'Specify the pattern
re.Pattern = "(d{3})(d{3})(d{4})"
'Use the replace method to perform the formatting
Dim strFormattedPN
strFormattedPN = re.Replace(strUnformattedPN, "($1) $2-$3")
View Replies !
View Related
Phone Book?
hy,
i'm starting to develop a project wich is kind of a phone book, the support will be a CD-ROM. The users will have the change to type what they'r looking for... well this project is destinated to all kind of target! it will contain the contacts and some information about the local commerce! The information displayed should be all dymanic!
I don't know yet the way i should do this, i'm still searching, i wonder if there's anyone who can give me some advices, or indicate websites, tutorials....
thanks
best regards
Catarina
View Replies !
View Related
How To Get My Flash App On My Phone
I've been searching flash help files to figure out how I can get the flash lite application I've created onto my phone and so far I haven't found the answer. Is it safe to assume that I need to ask my wireless provider for the answer? (Verizon)
Thanks
Troy
View Replies !
View Related
New Phone Book
I am new user here.
You can create your Phone Book.
In the Phone Book You can save your Phone number and Name
and see your Previous Number and name.
You want to see this click here.
___________________________________________
Free Website for you.
Disk Space:350 MB.
Bandwidth :10 GB.
No Ads on your page.
and more.Click here.
___________________________________________
View Replies !
View Related
Phone Book Menu
Hi to all,
I want to develop a navigation system mobile phone. Like u can see the list of persons and scroll through the list with the help of scrolling buttons. U can see example at:
http://www.sonyericsson.com/T68i/shockwave/index.html
Any help will be appreciated. Is there any tutorial to do such type of task.
Thanks in advance
Shailendra
View Replies !
View Related
Phone Book Menu
Hi to all,
I want to develop a navigation system like a mobile phone. For example, u can see the list of persons and scroll through the list with the help of scrolling buttons. U can see example at:
http://www.sonyericsson.com/T68i/shockwave/index.html
Any help will be appreciated. Is there any tutorial to do such type of task.
Thanks in advance
Shailendra
View Replies !
View Related
Validate Phone Numer
Hi
I want to validate a phone number field!
i want to check if the field is empty! thats no problem, nut then i want it to check if its only digits!! ex. 734897520 is ok but 2389074y3 will return a error message!
if (phone == "") {
errFlag = true;
currErrorNum++;
currErrors[i] = String(errorMess[4]);
i++;
}
else {
if (phone.indexOf("") == -1){<here i want to check if its only digits!
errFlag = true;
currErrorNum++;
currErrors[i] = String(errorMess[4]);
i++;
}
View Replies !
View Related
Cell Phone Displays?
I was checking out the trial for Flash MX 2004 when I seen cellphone templates for certain phones? Do these templates mean that you can use a flash interface on your cellphone? Or is it something like backgrounds or that sort of stuff.
Extremely curious so please let me know. I could have the coolest cellphone in town.
View Replies !
View Related
Actionscript, Phone Code
i have a phone, and i have a dynamic txt box called "safe" i want when you press butten "1" a 1 appears in the text, like a phone. And when there is a 1, it will make it 12 when you press "2" i dont want it to quit. unless the press clear, any ideas?
View Replies !
View Related
Cell Phone Links
I know there is a way to make a cell dial a number that is in HTML or Flash. SO when the number is highlighted, you can select it and it will dial it for you.
Anyone know how?
View Replies !
View Related
Free Phone Calls
Hey fellow flashers.
I set up this VoIP site up recently and from £25 quid you can get completely free landline calls.
Its great for small business etc, you can get a free phone number too.
check it out http://www.i-voip.co.uk
Let me know what you think.
Much love
Stef150
View Replies !
View Related
Cell Phone Pictures
I have a flash movie that displays pictures, but I thought it would be really cool if you could click a button and have the picture sent to your cell phone.
Verizon wireless already does this with Flash on their vtext.com site, but I was wondering how difficult it would be to add it to my site.
Any advice is greatly appreciated, thanks!
View Replies !
View Related
Controlling With Phone Tone?
Is there a way to get flash to respond to specific sounds?
I'm wanting to create a game where you can control the movement of the sprite using the buttons on a regular touch tone phone. In theory it sounds relatively easy you just get flash to respond when it 'hears' a specific tone but I have no idea how to do this. Does anyone know if it's possible?
I'm a newbie when it comes to actionscript but I've had a bit experience with lingo back in the days of director 7!
View Replies !
View Related
Flash -> Mobile Phone
I want to develop an application that allows a person to create an image by dragging elements onto the stage and then send it to mobile phone (preferable animated) Is this at all possilbe and if so where can I find more info on how to do this and the technologies involved.
Cheers
Philippe
View Replies !
View Related
Web Site On A Cell Phone
Ok, my client wants a "phone-version" of his site. No problem, I have Flash CS3 and it came w/ some templates, etc...
The problem is:
Can Flash "snif" if we are accessing the site from a cell phone? Or we MUST give ppl a different url?
Thanks in advance.
View Replies !
View Related
Emulating A Cell Phone
Hi Im trying to get a tricky project off the ground.
One aspect of it is to simulate a keypad on a cell
phone (button movement not necessary). I need
to utilize variables from the keypad buttons in either
number or alphabet form using a short delay
between input to put names and numbers into
an address book (for instance 2 is either: 2 [or A,B
or C during a short time frame]. I'll also need to search
into the phone book (array) using two number
combinations from the keypad. The readout screen
will show a text box with the name or number, plus one
box above and below showing the contents before
and after.
Any tips or advice to help me out in any way would be
appreciated. Perhaps you know of a sample piece
I can learn from.
View Replies !
View Related
Moble Phone Site
I want to create a site that can be accessed by mobile phone devices I’m new to this media format and have some general questions.
Can I have a page on my current site that is set for this media outlet?
If a page is not possible can I have a sub domain on my site that is set up for this media outlet?
What are the perimeters for this type of page / web site IE image format limits and requirements?
Thanks in advance for any help you may have to offer.
View Replies !
View Related
FMS Cell Phone To Laptop
I've been doing Flash / Flex / Apollo for awhile now, but I want to develop an application where a cell phone can communicate directly with a laptop on a wireless card. Does anyone know if FMS is the way to go with this? I just downloaded it and am reading up on it... Just VERY new to THIS technology, not adobe in general.
View Replies !
View Related
HELP Mobile Phone Coding......
Im trying to create a replica mobile phone in flash, but i need help so that when you press the bttons come up on screen, the numbers follow each other. When i do it, they always replace the previous one. Any suggestions??
View Replies !
View Related
Phone Registrer And Notes
I was working on the calendar fla and got the idea of making, in the same fla, a field for the user to make notes and save it the same way the calendar does.
And also make a field to save names and phone number. The user can search for a name in a field beside it.
Is it possible to make those features the same way the calendar?
View Replies !
View Related
Experiment Internet Phone
hi guys today rogers cable came along and changed my phone line to a huge line that is the same as my tV!!>!>! the box has a ethernet cable and he said that is for future internet use i was just wondering if he is lying and i can acutally use it but it is just a higher speed they dont want us to know about u think so?
View Replies !
View Related
Flash On Moble Phone
Does anyone know what phones support the development of Flash programs on their phone?
I want to be able to create my own screensaver, interface, look and feel, etc.
I know the iPhone has an SDK, but I'm only looking to program in Flash or Flash lite.
View Replies !
View Related
HELP Mobile Phone Coding......
Im trying to create a replica mobile phone in flash, but i need help so that when you press the bttons come up on screen, the numbers follow each other. When i do it, they always replace the previous one. Any suggestions??
View Replies !
View Related
Phone Registrer And Notes
I was working on the calendar fla and got the idea of making, in the same fla, a field for the user to make notes and save it the same way the calendar does.
And also make a field to save names and phone number. The user can search for a name in a field beside it.
Is it possible to make those features the same way the calendar?
View Replies !
View Related
Mobile / Cell Phone Typer
I need to create or get hold of a mobile phone interface built in Flash. The only functionality there needs to be is to beable to type in your name using the keys like on a real phone. Has to mimick a real phone. Also once typed in it needs to give you a preview of your name.
Can any one help me out with a source file or tutorial???
I'd really appreciate it if you could!
View Replies !
View Related
Only Allow Numbers Entered, Phone Mask?
Is there a way to do this. I've played with the input box component flash has to offer couldnt find such a property or a mask.
Email validation i did myself for the other input. since its a lot easier, but phone... well i cant let users enter anything but the phone number into it and cant seem to find a way to make this component do that.
so my question i guess is what i am trying to do possible in flash and if it is whats the way? our c# builder has it, i thought flash would have something like that too.
View Replies !
View Related
|