Skip to content Skip to sidebar Skip to footer

Disable Entire Form Elements With Respect To A State. React

I am disabling the inputs using the isFetching prop, but this is getting reduntant as I have to keep this in every input field. Is there a way to disable the entire form? Like a d

Solution 1:

I think this should solve your problem https://stackoverflow.com/a/17186342/3298693.

You should insert your form inside an element <fieldset disabled="disabled">. This will make the whole form disabled.

Solution 2:

I had the same issue and this worked for me:

<fieldsetdisabled={true}>

Where true would be some "prop.setting"...

Solution 3:

Just use <input type="text" disabled> wherever you want the input text to be disabled. It hardly takes some time.

Post a Comment for "Disable Entire Form Elements With Respect To A State. React"