Archive for the ‘Validation’ category

Good utility to mask your HTML input masks

November 15th, 2012

I wanted to give a little shout out to a little tool written by a guy named Josh Bush, you can find it here: http://digitalbush.com/projects/masked-input-plugin/. Basically it will mask your input fields and only allow numbers, letters, a combination of both, and also insert your characters in there if you want. I especially like the ability to have optional amount of characters in your input by using the ? in your mask like so, $(“#phone”).mask(“(999) 999-9999? x99999”), this allows the user to not have to put in those extra characters, like in this example, the extension.

Go check it out, its only 4k minified, so very small in your app. I went down the road of writing my own functions to validate my client side controls but found that only allowing the right data to be entered into the controls was an even better step. I hope this helps someone.