I am wanting to have a multi field input where someone enters the elements of an address and then that address is returned to them as a complete single string after pressing a submit button. So far I have the following which produced the entry fields and submit button but nothing happens when I enter a new address. I am unsure of how to make this happen:
app = dash.Dash()
app.layout = html.Div([
html.H1("Input new address"),
dcc.Input(
id = 'Property_name',
placeholder='Property Name',
type = 'text',
value = '',
),
dcc.Input(
id = 'Stree_name',
placeholder='Street Name',
type = 'text',
value = '',
),
dcc.Input(
id = 'City',
placeholder = 'City',
type = 'text',
value = '',
),
dcc.Input(
id = 'Zip_code',
placeholder = 'Zip code',
type = 'text',
value = '',
),
dcc.Input(
id = 'Country',
placeholder = 'Country',
type = 'text',
value = '',
),
html.Button(id='Submit_address', n_clicks=0, children='Submit'),
html.Br(),
html.Div(id = 'address'),
])
@app.callback([
Output('address', 'children')],
[Input('Property_name', 'value'),
Input('Stree_name', 'value'),
Input('City', 'value'),
Input('Zip_code', 'value'),
Input('Country', 'value')
])
def update_map(n_clicks, address):
if n_clicks is None:
return dash.no_update
else:
return f"Added new address at GeoCords: {address}"
if __name__ == '__main__':
app.run_server(debug=False)