Try our conversational search powered by Generative AI!

How to persist data in Forms(new block-based add-on) when validation fails.



In episerver forms(the new block-based add-on), after validation fails, any data entered is lost. Any suggestions how to persist data when validation is failed?



Mar 10, 2016 1:56

React to the event for step submitted and store data at that point? Mail or DDS would be my first options. 

Mar 10, 2016 7:42

Hi Daniel,

Sorry, my question was not very clear. The problem I am facing is: when user enters values in the form fields and clicks on submit, if there is any validation error, the values entered by user is lost. Any suggestion how to persist the values?



Mar 10, 2016 16:15

What do you mean with persist in this case? Save to database or similar or just keep them so user can easily change it?

If you want to save them to database or simliar I would guess implementing your own custom validation. You can do this by inheriting from ElementValidatorBase in that case and then in validate method save the data to your preferred data storage. 

Mar 11, 2016 10:23

I want to keep values on screen so that user should can change it, and submit the form again.

Mar 11, 2016 13:46
* 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.