Disable elements of the entire form relative to the state. to react

I will disable inputs using isFetching prop, but this becomes redundant as I have to keep this in every input field. Is there a way to disable the whole form? Like the disable property in the <form> or something else?

 <form> <input type="text" disabled={this.props.isFetching} /> <input type="text" disabled={this.props.isFetching} /> </form> 
+7
javascript html reactjs forms
source share
3 answers

I think this should solve your problem fooobar.com/questions/79159 / ....

You must insert your form inside the <fieldset disabled="disabled"> element. This will disable the entire form.

+12
source share

I had the same problem and it worked for me:

  <fieldset disabled={true}> 

If true, it will be "prop.setting" ...

0
source share

Just use <input type="text" disabled> wherever you want the input text to be disabled. This is unlikely to take some time.

-5
source share

All Articles