The current (non) solution I attempted was having a button with a dynamic action in 2 parts:
Submit (sequence 10)
Exec JS Code (Sequence 20)
The JS is attempting to get all elements with the error class name added after the validation fails.
console.log("Error element test triggered");
const errorElements = document.getElementsByClassName("apex-page-item-error");
if(errorElements.length > 0)(
On the first button click I can see the submit, js exec, then the console.log saying it's been triggered. On the second, it has the same result with the HTMLCollection added. To me this indicated that either validation doesn't occur until all of the dynamic actions are complete or the classes aren't added until after all of the dynamic actions are complete.
Given this, I have a few questions:
Can the JS execute after validation?
Is there a built in list of elements that can be accessed that failed validation?
Is validation tied directly to submitting? If so, why does the item-error class not get added until after it fails?
What is the order of execution after submitting a page?