AI OnAI Off
For anyone that comes across this, the below bit of documentation was a huge help after I finally found it.
https://world.episerver.com/documentation/developer-guides/forms/configuring-episerver-forms/
Setting the below in the Forms.config file disables the client-side validation of EPiServer forms.
workInNonJSMode="true"
From there, the client-side validation that we use on the custom elements is used solely and does prevent the form from being submitted by the submit button. We also have custom server side validation set up that mimics the client-side validation.
Hello,
We've recently moved over to using EPiServer Forms and have created some custom elements that have their own custom validation (server and client side). Some of the forms that we use are rather long and when clicking on the submit button it autofocuses on the first field with an error, which can be a bit jarring. Also, we use a validation method on the custom fields that will validate the field when the field loses focus to give a more instant feedback to the user. One of the features of the validation is that when a user goes back to a previous field it will clear the validation, let the user finish with their change, and then validate it again. The problem is with the autofocus on the first field with an error it immediately clears out the validation message.
Is there a way to prevent this autofocus from occurring from EPiServer Forms validation?
Thank you,
Kevin Larsen