Support Article
Validation conflict with numeric properties
SA-20775
Summary
Number and Integer fields accept the letter E to support scientific notation.
Reference: https://pdn.pega.com/support-articles/number-presentation-format-accepts-character-ee
User wants to know how to turnoff so the control only allows numbers?
Using edit-validate rules one can supply validations using regular expressions to only allow digits.
But if user simply type one or more e's in an input field you are still allowed to submit the form. Why?
Error Messages
Not applicable.
Steps to Reproduce
Put 'e' or 'E' in a number control.
Root Cause
A third-party product issue and not a Pega defect.
There is an inconsistency with how browsers behave with the current HTML5 number input type standard.
The same behavior can be witnessed outside of a Pega application.
Resolution
The explanation for the reported behavior is as follows:
In Chrome user is allowed to type 'E' and the + or - sign. All other characters are not allowed to even be typed in the field.
In IE 11, user can type anything into a number input field. But upon tab out or blur the browser will wipe out the field if it is not a valid number.
In Chrome it does not nullify the input field until one actually submits the form.
So in both cases, the reason why user is able to submit the form is because the edit-validate rules were not even invoked, and also because there were no values to even validate.
The browser itself wiped the values before Pega has a chance to perform any actions.
Published March 12, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.