Support Article
Incorrect error message displays for value in numeric field
SA-67074
Summary
Incorrect error message 'Value cannot be blank' displays on entering 12345678990123e4 in the number field. This error displays for 'e' (in the value entered) which is an incorrect character for the numeric field.
Error Messages
Value cannot be blank
Steps to Reproduce
- Create a Text input which is configured with Number.
- Set Required as Always.
- Enter 123e in the numeric field and focus out. Incorrect error message displays.
- Enter 123 in the field and focus out. User can proceed further in the flow.
Root Cause
A third-party product issue: Browser behavior.
Resolution
Perform the following local-change:
Save As the below script as an HTML file and run it in different browsers:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Client 1</title>
<script>
function alertValue(e){
alert(e.target.value);
}
</script>
</head>
<body>
<span > Please enter a value </span>
<input id="NumberProp" type="number" onchange="alertValue(event)" />
</body>
</html>
In the Internet Explorer browser:
The Internet Explorer browser does not restrict alphabets in numbers. Hence, it alerts the value. As the type is number, the input value is validated accordingly and the error message '123er is not a valid integer value' displays.
This is an issue with the browser and not an issue with the Pega application.
In Chrome and Firefox browsers: On entering '123' and tabbing out of the number field, '123' displays in the alert box. However, on entering '123e' and tabbing out, the browser returns an empty value. Pega displays the 'Value cannot be blank' error message accordingly.
Published March 22, 2019 - 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.