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

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.

1 Like

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.

1 Like

Hi @Eduardo, thanks for your help. It works :slight_smile:

1 Like