Our thanks goes to Rocketgenius (the team behind Gravity Forms) for this information, which we have shared here for ease of reference.
Input masks provide a visual guide allowing users to more easily enter data in a specific format such as dates and phone numbers. The input mask in the image above allows the user to add two digits for the month, two digits for the day, and four digits for the year. No letters or any other characters will work, only numbers.
Accepted Input Mask Characters #
The following symbols are accepted as placeholders in input masks and provide some basic pattern matching.
|9||Accepts any numeric character|
|a||Accepts any alphabetic character (must be lower case)|
|*||Accepts any single alphanumeric character.|
|?||Indicates that all characters defined by the mask after the question mark are optional.|
|any other||All other characters are literal values and will be displayed as is.|
- A customer will only see underscores when they enter the field, which identifies the quantity of characters the field expects, but not their type. We recommend you provide additional visual help for complicated masks, such as a field description or a placeholder example.
- If the “Enable password input” advanced property is checked, it will override the input mask functionality.
Here are some sample masks, and what an accepted input would be.
99/99/9999 → would accept
21/05/2011, but not
05/21/11 and not
Social security mask:
999-99-9999 → would accept
987-65-4329 but not
aaa 999 → would accept
BIO 101 but not
***-***-*** → would accept
US Zipcode+4 mask:
99999?-9999 → would accept