How pre-defined masks work
- Each key stroke is evaluated.
- If the key stroke is valid, the standard mask will be shown.
- If the key stroke is invalid, allowable values will be shown.
- For fixed length masks, a green check will appear when the input is both valid and complete.
Mask key specifications
You can specify one of three positions to show help (and error) messages
- the default is 'right' (the other options are 'top' and 'bottom')
User defined Masks
Requirements for user defined masks
- "Mask" must be an object
- (not a string, as in pre-defined masks)
- "Mask" object must contain the 'Whole' key
- which specifies the use defined RegExp
- You do not get the character by character validation (and therefore, the character specific error messages) with user defined masks.
- If you use FixedLen with a user defined masks, it is helpful to make the 'HelpMsg' massage be that exact length. This will make the progress highlighting behave as intended (i.e., showing the user how many valid characters were entered and how many need to be entered to fufill the 'FixedLen' requirement).
This is the RegExp that matches the input and signifies that the input is completed (the one exception is if the FixedLen is defined - in that case, the input is not complete until the FixedLen character count is reached)
When using a User Defined masks, you can specify the Help message text to display while user is inputting data into the input element.
When using a User Defined masks, you can specify a FixedLen. To pass validation, the input string must be this exact length.
- when using FixedLen, if the user input passes the Mask test and the FixedLen is reached, the onSubmit event will be triggered with data.type set to 'Completed'. This allows a developer to automatically proceed (e.g., with a database update) once the last valid character has been entered (enter key becomes optional).
Mon DD, YYYY
"Mask": "Mon DD, YYYY"
Note: the "Phone" mask saves the phone number as numbers (formatting is stripped) in the menu_opt_key
"Mask": "HH:MM AM"
Note: the "Money" mask saves the amount as a float in the menu_opt_key