# How can I disable a dbc button until the user fills some input fields?

**URL:** <https://community.plotly.com/t/how-can-i-disable-a-dbc-button-until-the-user-fills-some-input-fields/49832>\
**Category:** Dash Python\
**Created:** [February 8, 2021, 8:46pm UTC](https://community.plotly.com/t/how-can-i-disable-a-dbc-button-until-the-user-fills-some-input-fields/49832 "2021-02-08T20:46:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vicodin](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@Vicodin](https://community.plotly.com/u/Vicodin)\
**Post date:** [February 8, 2021, 8:46pm UTC](https://community.plotly.com/t/how-can-i-disable-a-dbc-button-until-the-user-fills-some-input-fields/49832/1 "2021-02-08T20:46:27Z")

</div>

Hi everybody, I’m new both in dash and in web development. I’m building a simple web page and I want that a button is disabled until the user fills some inputs. How can I do it? Moreover the fields that the user have to fill are used in the generation of some plots, can I achieve what I want with just one callback or should I use two callbacks? I think that it’s possible with just one, but I don’t know how to do it.

---

<div class="post-metadata">

**Author:** ![Eduardo](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/eduardo/32/13310_2.png) [@Eduardo](https://community.plotly.com/u/Eduardo)\
**Post date:** [February 8, 2021, 9:03pm UTC](https://community.plotly.com/t/how-can-i-disable-a-dbc-button-until-the-user-fills-some-input-fields/49832/2 "2021-02-08T21:03:23Z")

</div>

Hi @Vicodin

You can set your html.Button property **disabled = True** and in the callback use as input the **value** property of the last Input and as an output the **disabled** property of your button id and change it to **False**.

You need at least two callbacks, one to change the button disabled property and other to run the code ones the button is clicked.

---

<div class="post-metadata">

**Author:** ![Vicodin](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@Vicodin](https://community.plotly.com/u/Vicodin)\
**Post date:** [February 10, 2021, 4:24pm UTC](https://community.plotly.com/t/how-can-i-disable-a-dbc-button-until-the-user-fills-some-input-fields/49832/3 "2021-02-10T16:24:02Z")

</div>

Hi @Eduardo, thanks for your help. It works 🙂
