Try our conversational search powered by Generative AI!

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

Vote:
 

Hi,

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?

Thanks,

Vivek

#145688
Mar 10, 2016 1:56
Vote:
 

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

#145690
Mar 10, 2016 7:42
Vote:
 

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?

Thanks,

Vivek

#145735
Mar 10, 2016 16:15
Vote:
 

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. 

#145778
Mar 11, 2016 10:23
Vote:
 

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

#145788
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.