Hi, so disclaimer - very new to dah and just learning. I am following the app call back docs.
I want to have three empty boxes, two boxes where a user puts input, and the third box will output the result. I have managed two input boxes but there is an error saying :
“TypeError: update_output_div() takes 1 positional argument but 2 were given”
Im guessting i have to add another input into the argument of the method. But no idea what to put. Here is my good so far/ its copied and tweaked from the docs.
from dash import Dash, dcc, html, Input, Output
app = Dash(__name__)
app.layout = html.Div([
html.H6("Change the value in the text box to see callbacks in action!"),
html.Div([
"Input: ",
dcc.Input(id='my-input1', value='initial value', type='text')
]),
html.Div([
"Input: ",
dcc.Input(id='my-input2', value='initial value', type='text')
]),
html.Br(),
html.Div(id='my-output'),
])
@app.callback(
Output(component_id='my-output', component_property='children'),
Input(component_id='my-input1', component_property='value'),
Input(component_id='my-input2', component_property='value'),
)
def update_output_div(input_value):
return f'Output: {input_value}'
if __name__ == '__main__':
app.run_server(debug=True)
Here is the output;
Thanks for any help.