by Fabio Zendhi Nagao (http://zend.lojcomm.com.br)
iMask is an open source (free) javascript tool for creating input and textarea masking.
Who haven't ever wanted to apply an input mask to an HTML form field? This very common feature in traditional GUI applications is not natively supported by web applications. iMask goal is to implement an easy way for developers to add mask into their form fields, increasing the database and software consistency with standard compliant XHTML and unobtrusive JavaScript.
iMask is compatible and tested in Internet Explorer, Firefox (and its mozilla friends), Opera and Safari (thanks macspyre for testing it). But it should work in other browsers too... If you successfully find another compatible browser, please let me know ;)
1. keyboard control
|
2. dynamic fixed mask definitionCreate your own masks for type "fixed" using [9, a, x] notation: 9 := numerical symbols. A := alphabetical symbols. X := alphanumerical symbols. |
3. event handlingIntegrate with other components and create rich interactive interfaces. iMask class can be initialized with the following customizable methods:
|
4. dynamically charset definitionWant to extend the default charset for a card? [9, a, x] Initialize iMask with your own set of validNumbers, validAlphas and validAlphaNums! |
First of all, iMask is built over MooTools v1.1, so both libraries are required.
Get MooTools at http://mootools.net and iMask here.
With scripts in hands, include them between your "head" definition:
This piece of code is is released under the Open Source MIT license, which permits you to use it and modify it in every circumstance. For more details read it below:
Copyright (c) 2007 Fabio Zendhi Nagao - http://zend.lojcomm.com.br
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
iMask is available in the formats below:
05/22/2007 : v1.0 - first public release
03/16/2007 : v0.002
03/11/2007 : v0.001
First release3/10/2007 2:06:20 AM
Nice indeed3/21/2007 5:29:13 PM
Not working ...3/23/2007 7:10:41 AM
Looks great!3/25/2007 12:15:46 PM
Great lib3/26/2007 2:45:26 PM
Great!4/16/2007 10:33:34 AM
Great work.. but...4/21/2007 10:28:17 PM
Two lil' things..5/6/2007 2:07:13 PM
Nice but,5/23/2007 6:49:20 AM
Exactly what I am looking for5/26/2007 1:14:51 AM
2 things missing5/31/2007 9:58:09 AM
Great start6/4/2007 6:56:04 AM
Opera6/7/2007 6:48:47 AM
Tabbing bug6/11/2007 2:40:04 PM
Can't enter data if stripMask=false and no initial value6/27/2007 5:44:54 PM
using iMask with Ajax6/27/2007 6:30:17 PM
Stripmask7/18/2007 10:21:18 AM
stripMask7/27/2007 2:30:40 PM
A great job7/30/2007 3:21:30 PM
Tabbing Bug8/2/2007 2:50:35 PM