InputMask is a script that contains several masks - classes that format and restrict the user input on form fields. There are 4 types of masks:
All masks follows these rules:
control
is the control reference, and the property
mask
is added to the control. See each mask for more details.with (new InputMask("AA/##", "myControl")) { keyUpFunction = function(event, mask) { setValue("output", "A key was pressed. My current value is " + mask.control.value) }; updateFunction = function(mask) { setValue("output", "I have been updated. My current value is " + mask.control.value) }; };Important: The standard event handlers (keyPressFunction, keyUpFunction, keyDownFunction and blurFunction) are evaluated by the control, so, inside the code,
this
refers to the control (this has been changed on version
2.1, so, the same event handler you would normally use on a control you can use with the mask). The updateFunction, that is
mask specific, is evaluated by the mask, so, this refers to the mask.Previous: Other parsers |
Table of Contents | Next: Working with the InputMask |