Issue
After updating to releases after Pega Platform™ 8.8, users experience unexpected restrictions when entering numbers in fields with decimal separators.
Symptoms and Impact
Symptoms:
-
Users cannot enter the full number of digits specified in the maximum character setting.
-
Input field stops accepting characters before reaching the expected digit limit.
-
The issue occurs specifically when number formatting with separators is enabled.
Impact:
-
User Experience: Users are unable to enter valid numeric values that should be within the specified limits.
-
Data Entry: Reduced efficiency in data entry processes, particularly for financial and numeric data.
Steps to Reproduce
1. Create a numeric property:
- Open > >
- Create a new property with type Decimal, Currency, or Integer.
2. Configure the control.
3. Add the property to a section using a Text input control.
4. In the Presentation tab:
- Set Maximum characters to 6.
- Select Editable format.
- Check Display value using read-only formatting.
- Ensure Separators is set to Yes.
5. Test the behavior:
- Preview the form in a browser.
- Attempt to enter a 6-digit number (e.g., 123456).
- Observe that input stops after 5 digits when the comma separator is added.
6. Verify the issue:
- The field displays 12,345 and prevents further input.
- The comma is counted as one of the 6 maximum characters.
Root Cause
The issue was introduced in Pega Platform 8.6.0 where the system began incorrectly counting comma separators (group separators) as part of the Maximum characters length for numeric fields when the Display value using read-only formatting option is enabled.
Key Configuration Factor:
The issue specifically occurs when:
-
Property type is Decimal, Currency, or Integer.
-
Display value using read-only formatting is checked in the Presentation tab.
-
Separators are enabled ("Yes").
When Display value using read-only formatting is enabled, the system generates input type="text" to display currency/number values using read-only formats which include separators. This causes the maxlength attribute to be considered, incorrectly including separators in the character count.
Solution
This issue is fixed in Pega Platform ‘24.2.0 and later versions. It has been resolved through updates to the text input control generation logic.
With the new approach Max characters restriction will work with read-only formatting. The behavior will be different for typing and pasting.
-
While typing, if is exceeded, the last typed value will be removed.
-
For copy-paste max length scenarios, if the pasted value exceeds max length, it will be trimmed from the right.
Local changes for earlier releases:
-
Disable the Display value using read-only formatting option to prevent separator formatting.
-
Use min/max value validation instead of character length validation for numeric fields.
-
Implement custom validation rules that exclude formatting characters from length calculations.
Alternative approach:
-
Use the Number control type instead of Text input for numeric properties.
-
Configure validation using Minimum value and Maximum value settings rather than character limits.
References
Configuring a Text input control
Setting the maximum characters limit
Text input control configuration
Property form - Completing the Advanced tab
maxlength ignored for input type="number" in Chrome