views:

84

answers:

2

I recently filled out a form and when I got to the phone number textBox I noticed some really cool things going on. As I entered my number, general phone symbols were getting added automatically. Example:

I start entering my area code '555'

and my input was changed to 1 (555)

to test what just happened I backspaced on the ) and it quickly added it back in.

So my question is, how do I get this input to happen?

+1  A: 

If this was an aspx page, they were probably using the AJAX Control Toolkit MaskedEdit Extender. There is also the Masked Input plugin for jQuery.

Bradley Mountford
That looks like something I could use. However what I saw was different. You were not able to see the full mask until after you passed where the character would go.
Rkstarcass
There are probably other plugins that do this...or they wrote their own. It would just be a matter of checking the current character count on key up and adding additional characters at the appropriate places.
Bradley Mountford
+2  A: 
Geek Num 88
This is what i'm looking for!! Thanks.
Rkstarcass
do you need the library script?
Geek Num 88
Yes, that would be helpful.
Rkstarcass
added the script to the answer above
Geek Num 88