Automatically formatting form input values
When you design a form, you can have the Pega 7 Platform automatically format the input values in a property to improve readability and processing. The default edit validate rules that are included with the product can help you format the values for the following standard formats:
- Date (user locale settings determine the format)
- Social Security Number (SSN)
- Taxpayer Identification Number (TIN)
- U.S. ZIP code
- U.S. extended ZIP code (ZIP+4)
- U.S. phone number
- International phone number
You can also format the values in various formats by creating a custom edit input rule. You then reference this rule in the property rule form. For more information about how to create this type of rule, see About Edit Input rules.
To configure the input property format:
- Open the input property rule.
- On the Advanced tab of the rule form, do one of the following steps:
- To format the value as a standard format, enter an edit validate rule in the Use validate field.
- To format the value as a custom format, enter an edit input rule in the Edit input field. If a post value action is configured for a field, the value is formatted when the cursor moves from the field; otherwise it is formatted when the section is refreshed.
At run time, when you enter data in this field, it is displayed exactly as you enter it. The data format changes when you exit the field.
For example, if you enter 000112222 in a field that uses SSN as a validate rule, it is automatically displayed in the correct format as 000-11-2222.