Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto-format structured data (phone, date) using jQuery plugin (or failing that vanilla JavaScript)

Tags:

I like jQuery and I was wondering if anyone have used a good plugin or (non-jQuery) JavaScript library that allows for auto-formatting of structured fields like phone numbers or dates. I know of the jquery-ui-datapicker plugin, and not what I am looking for here. You may type in a phone number as 123 which then becomes (123), additional numbers will be formatted as (123) 456 7890 Ext. 123456. If you press delete the auto-formatting stuff disappears automatically, and repositioning of the cursor, say, after (123) and pressing delete will remove the 3 and make the rest (124) 567 8901 Ext. 23456. The ones that I have played with appears unreliable.

like image 482
Allan Wind Avatar asked Sep 21 '08 00:09

Allan Wind


1 Answers

Does the Masked Input plugin do what you need or that one you have already found to be unreliable?

like image 124
dgvid Avatar answered Oct 02 '22 11:10

dgvid