Disabling all the fields in a form (Formik)

atosh502

Aashutosh Poudel

Posted on April 5, 2022

Disabling all the fields in a form (Formik)

I needed a way to disable the entire form in Formik until the data fetching or submission was complete. For this I found a tag that can enable or disable the entire form. We simply need to wrap our form components inside the <fieldset> tag and pass true to attribute disabled and then all the elements inside the form will be disabled.

Original comment
Reference code from mdn

💖 💪 🙅 🚩
atosh502
Aashutosh Poudel

Posted on April 5, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related