Start a new topic
Answered

Validations in stepper performed after steps validations

Is there a way to configure validations in a stepper so that error messages would not be shown at form open, but shown after the step validations have been evaluated? 

Like for instance a form with many mandatory text fields. We dont want to have the error messages shown on form open because a) it is not very user friendly to have a form where everything is shown as an error, in red, before the user has even started to fill it in, and more importantly b) because the error-text completely covers the helper-text, needed to fill in the form. 

We would like to show the errors after they have failed the step validation, to indicate which mandatory fields need to be filled in.

On data-change does not help here, since mandatory fields are in error when no data has been changed.

Any suggestions on how to handle this?


Best Answer

You can either

  • Duplicate your step so that your first step just has Transition Validations activated, and the second has On form open and On data change validations activated/
  • Build your own Validations so that you trigger an enricher on step exit (pre-validation), that will enrich a technical field called "userFinishedTheForm"=true, and your own validations will check the current validations and the userFinishedTheForm=true
1 Comment

Answer

You can either

  • Duplicate your step so that your first step just has Transition Validations activated, and the second has On form open and On data change validations activated/
  • Build your own Validations so that you trigger an enricher on step exit (pre-validation), that will enrich a technical field called "userFinishedTheForm"=true, and your own validations will check the current validations and the userFinishedTheForm=true
Login to post a comment