dgaly
November 16, 2012, 2:33am
1
Background:
I have created a form for persons to enter their phone number. I would like the form to automatically add dashes (-) between the first three number and second three numbers. i.e. 123-456-7890.
Here is my code but it doesn’t seem to work.
[php]
[/php]
Any help is greatly appreciated!
m11
November 16, 2012, 3:06am
2
You have a typo here:
onBlur="addDahes(this.value)"
Also, the function should not be looking for this.value since this.value is passed as f
For example:
if(f=='')
f='Phone:'
else
f = f.slice(0,3)+"-"+f.slice(3,6)+"-"+f.slice(6,10);
}
I have a function that i downloaded from a website that works perfect, if you want it let me know.
dgaly
November 23, 2012, 5:41am
4
Wilson 382 thank you for all your help!! Very much appreciated!!