Support Article
Error message flashes away on clicking outside the field
SA-72407
Summary
Error message flashes away on clicking outside the field. This occurs when there is a Required condition and Edit validate rule on a property. However, this works on click of tab, if the property is on a data page.
Error Messages
Not Applicable.
Steps to Reproduce
- Create a property with a Required validation and Edit validate rule for a positive integer
- Input a negative value in the integer field
- Focus out of the field using the mouse
Root Cause
A defect in Pegasystems’ code or rules. In this case, there is a server side error or validation on a field along with client side validations. If the client side validations pass, the errors clear, even if the server side error is present on the field.
Resolution
Perform the following local-change:Configure an edit validate or validate rule to check the required input on the server instead of a required client validation on the field.
Alternatively, configure a corresponding client validation for the edit validate. Add the following script to a custom script and include it in the harness:
function positiveInteger_Validation(elem){
if(parseInt(elem.value)>0 || elem.disabled ){
return;
}else{
return (new validation_Error(elem,"Enter a positive value!"));
}
}
positiveIntVal = new validation_ValidationType("pzIsPostiveInteger",positiveInteger_Validation);
positiveIntVal.addEventFunction("onblur", positiveInteger_Validation);
positiveIntVal.addEventFunction("onchange", positiveInteger_Validation);
Published August 19, 2019 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.