Disable validation for whole form. #2849
Replies: 6 comments 10 replies
-
This is going to be very tricky because of all those external controlled inputs (MUI, antD and etc...) it's better at your app level to disable that submit button. |
Beta Was this translation helpful? Give feedback.
-
Are you saying that when you submit the form, you don't validate the required options in the form? |
Beta Was this translation helpful? Give feedback.
-
I would like to have this feature as well, I want to use address previously saved by the user in the dashboard but use this same handler as I have some logic there that could be reused because the shape of the data is this same and i can not because validation does not allow me to click the submit button |
Beta Was this translation helpful? Give feedback.
-
Similar behaviour I've implemented with zod validation for "Save as draft" and "Regular submittion" buttons.
|
Beta Was this translation helpful? Give feedback.
-
i found a simple solution, hence posting here |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There should be some argument in useForm by which we can disable validation for the whole form.
Suppose I have put the validation for the whole form using RHF. Now for the some reason I have to remove the validation for a moment in whole form, so now what I do, comment all the validation part in each input field. So I am saying there should be some argument in useForm for disabling the validation in the whole form for a moment.
example:
const {} = useForm({ disableValidation:true })
Beta Was this translation helpful? Give feedback.
All reactions