Support Article
Validation error does not go away for file path control
SA-31237
Summary
The user has configured a validation error to be displayed when .txt files are uploaded using file path control. after the validation error is displayed, if the user chooses to upload a file that is allowed (for example .pdf), the error icon next to the file upload does not go away. It appears as if the form is still in error state when the user submits the form, which is causing them to be confused about proceeding forward in the flow. The UI is not accurate to their adherence to the validation requirements.
Error Messages
Not applicable
Steps to Reproduce
- Add a filepath control to a section and configure a validation rule for it.
- At runtime, add a file and trigger the validation error to be displayed.
- Now choose a new file, the error icon is still displayed.
Root Cause
The errors will not be removed unless the UI is refreshed/resubmitted again.
Resolution
Save the filepath control to custom ruleset and add the below snippet at the beginning of function updateDescription(src).
var errorElement = document.getElementById(src.name+"Error");
if(errorElement && errorElement.style.display == "block"){
errorElement.style.display = "none";
}
Published December 9, 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.