3

I'd like to have a phone number text field pre-formatted for a 10 digit number, like so (pipes not included, just delimiting field):

|(   )    -    |    

and have the numbers the user enters fill in appropriately

|(804) 479-1832|

I found a good script for formatting correctly as the digits are entered here, but nothing yet that delivers a preformatted structure.

Is there a simple library or link for this? Thanks.

JohnB
  • 1,231
  • 1
  • 18
  • 33
steve_gallagher
  • 3,778
  • 8
  • 33
  • 51
  • possible duplicate of [Auto-format structured data (phone, date) using jQuery plugin (or failing that vanilla JavaScript)](http://stackoverflow.com/questions/109854/auto-format-structured-data-phone-date-using-jquery-plugin-or-failing-that-v) – JohnB Jul 19 '13 at 00:43

1 Answers1

9

Check this Masked Input Plugin. It seems to be what you're looking for.

Claudio Redi
  • 67,454
  • 15
  • 130
  • 155