Support Article
Validation message is lost on focusing in and out of the field
SA-72767
Summary
Validation message is lost on focusing in and out of the field.
Error Messages
Not Applicable.
Steps to Reproduce
- Create a mandatory field
- Add an action set on change to refresh the section
- Add a validation rule in the flow action
- Enter an incorrect value
- Focus in and out of the field
Root Cause
Client side validation called during refresh section removes the server side validation.
Resolution
Perform the following local-change:Add the below code in the UserWorkForm:
<script> $(document).ready(function(){ function display_showImageErrors(errorList, successList, serverErrors) { var display_removeErrorImageRef = display_removeErrorImage; var display_addImageErrorRef = display_addImageError; if ((serverErrors != true) && !(serverErrors && serverErrors.type === "blur")) { var successListLength = successList.length; for (var i = 0; i < successListLength; i++) { display_removeErrorImageRef(successList[i]); // only call if we have tab group included if (typeof pega.u.d.handleErrorsInTabgroupLayout == "function") { pega.u.d.handleErrorsInTabgroupLayout(successList[i], "clear"); } } } var errorListLength = errorList.length; for (var i = 0; i < errorListLength; i++) { display_removeErrorImageRef(errorList[i].element); } for (var i = 0; i < errorListLength; i++) { display_addImageErrorRef(errorList[i]); // only call if we have tab group included if (typeof pega.u.d.handleErrorsInTabgroupLayout == "function") { pega.u.d.handleErrorsInTabgroupLayout(errorList[i].element, "add"); } } if (window.LayoutGroupModule) { LayoutGroupModule.checkForErrors(); } } validation_displayErrors = display_showImageErrors; validation_displayFieldError = display_showImageErrors; }); </script>
Published February 7, 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.