Input Masking Documentation for Field Configuration
Input masking ensures that users input data in predefined formats. This helps maintain data accuracy and consistency across forms.
Masking Formats:
9
: Numeric digit (0-9)- Example:
999-999
→123-456
- Example:
a
: Alphabet (A-Z, a-z)- Example:
aaa
→abc
- Example:
*
: Alphanumeric (A-Z, a-z, 0-9)- Example:
A1b2
- Example:
[ ]
: Optional input- Example:
+99 [999]
→+99
or+99123
- Example:
Regular Expressions (Regex):
For advanced scenarios, use regex to define custom masks. Regex allows for highly flexible input patterns, such as:
\d{4}-[A-Za-z]{3}
: This ensures a format like1234-ABC
.
Masking Examples:
- Phone Number:
(999) 999-9999
- Enforces input like
(123) 456-7890
- Enforces input like
- Date:
99/99/9999
- Ensures a format like
12/31/2024
- Ensures a format like
- Regex Example: Use
\d{4}
to allow only four-digit input.
Advanced Options:
- Optional Characters: Use square brackets
[ ]
to define optional parts of the input. For example,+99 [999]
allows the optional entry of a country code. - Custom Placeholder Characters: Change the default placeholders used in the mask by specifying custom ones. For instance, you can replace the default underscores with another symbol to improve clarity.
How to Use Input Masking in Field Configuration:
- Specify Mask Format: In your product’s configuration, users will input the desired mask format (e.g.,
999-999
for a phone number). - Define Custom Masking Rules with Regex: For more advanced configurations, users can provide regular expressions to enforce specific validation patterns. Make sure to check the Use Regex Expression checkbox in case your mask uses Regex.
Link to Detailed Documentation:
For more detailed information and usage guidelines, refer to the full Inputmask documentation.