Skip to content

jQuery Masked Input

August 25, 2010

Found this plugin for jQuery for masking input boxes to restrict input to a specific format. http://digitalbush.com/projects/masked-input-plugin/ Definitely pleased with this plugin. Very easy to use, and the format for specifying masks is easy as well.

$("#CellPhone").mask("(999) 999-9999");

That’s how easy it is to set up a mask. I do have one problem with it though. It’s basically a one to one mapping for characters (you can specify optional sections on the end) but it doesn’t allow something more regex based. For instance: at least one but up to three letters, followed by 6 numbers (a135923 and ab473922). I will probably try to extend it if I ever run across this situation though. Give it a look if you need to restrict input on textboxes.

From → Javascript, Portfolio

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.