November Happy Hour will be moved to Thursday December 5th.

Disable Client Side Validation Error Autofocus

Vote:
 

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

#197072
Edited, Sep 20, 2018 19:08
Vote:
 

Any thoughts or input on what could be done?

Thank you!

#197148
Sep 24, 2018 20:57
Vote:
 

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.

#197237
Sep 26, 2018 16:39
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.