Class Toggle on Form Success

Is there a way to toggle a class on a form submit success?

Currently I have a class toggle set on the form element itself, dmx-class:was-validated=“state.executing” and it works great 90% of the time to clear my client side validation once the form submits.
However if I have server side validation that fails and is meant to show an error message on my form, like with server side validate if record exists in database, then the class toggle fires before the form fails and the user can not see the error.

Hope this makes sense.

Community Page
Last updated: