data-driven-forms / react-forms

React library for rendering forms.
https://data-driven-forms.org/
Apache License 2.0
304 stars 87 forks source link

Disable form validation and capture form values for save draft functionality #1488

Open adityapatil9191 opened 1 month ago

adityapatil9191 commented 1 month ago

Scope: <DESCRIBE SCOPE OF THIS ISSUE, i.e.: PF4 mapper, Form renderer> MUI Form renderer

Description I want to develop a functionality called save as draft which should disable form validation on submission of the form and capture the form values entered by the user. I checked the documentation but I did not find any solution to this.

Schema

This can be done with any schema available.

<If it's possible, please provide a schema which reproduces the issue>

Hyperkid123 commented 1 month ago

@adityapatil9191 you can use the form api in a custom element (or develop your own form buttons) in your form which will do this for you. You can either pause the validation or just grab the form values directly from the state. Depends on your need. You can use the useFormApi to get the state.

https://www.data-driven-forms.org/hooks/use-form-api