Hi everyone,
I am currently creating a contact form in which there is an input for a phone number.
As I’m French, I want the phone number to match French phone number format: “01 23 45 67 89” (10 digits long written in groups of two separated by spaces).
I want to create a script that applies the changes while the user is typing.
I created [URL=”http://jsfiddle.net/DsWgw/1/”]this function
I thought the way for the function to do exactly what I want is to insert the digit, then delete all the spaces and finally add spaces at the right place, but actually I am not good at all in algorithmics :/ and I noticed that the function I created is executed before the digit is inserted so it won’t work.
Any idea?
Thanks