# Dash button not working

**URL:** <https://community.plotly.com/t/dash-button-not-working/56818>\
**Category:** Dash Python\
**Created:** [September 21, 2021, 10:08am UTC](https://community.plotly.com/t/dash-button-not-working/56818 "2021-09-21T10:08:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![phuonghao145](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/phuonghao145/32/15805_2.png) [@phuonghao145](https://community.plotly.com/u/phuonghao145)\
**Post date:** [September 21, 2021, 10:08am UTC](https://community.plotly.com/t/dash-button-not-working/56818/1 "2021-09-21T10:08:44Z")

</div>

Hi guys,  
I just try Dash button. But it not working.  
Please help me.  
My code here.

```auto
import dash_core_components as dcc
import dash_html_components as html
import dash
from dash.dependencies import Input, Output

app = dash.Dash( __name__ )

app.layout = html.Div(
    [
        dcc.Input(
            id="input",
            type="text",
            placeholder="input type {}",
        ),
        html.Div([
            html.Button('Submit', id='submit-val'),
            html.Div(id="out-all-types")
        ])
        
    ]
   
)

@app.callback(
    Output("out-all-types", "children"),
    Input("input", "value") ,
    Input('submit-val','value'),
# prevent_initial_call=True,
)
def cb_render(vals,n_clicks):
    print(n_clicks)
    if(n_clicks!=None):
        print('val',vals)
        print('val',vals[0])
        return vals
    return 0

if __name__ == " __main__":
    app.run_server(debug=False)

```

---

<div class="post-metadata">

**Author:** ![MichelH](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@MichelH](https://community.plotly.com/u/MichelH)\
**Post date:** [September 21, 2021, 11:20am UTC](https://community.plotly.com/t/dash-button-not-working/56818/2 "2021-09-21T11:20:52Z")

</div>

Instead of  
`Input('submit-val','value'),`  
you probably want  
`Input('submit-val','n_clicks'),`

---

<div class="post-metadata">

**Author:** ![phuonghao145](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/phuonghao145/32/15805_2.png) [@phuonghao145](https://community.plotly.com/u/phuonghao145)\
**Post date:** [September 21, 2021, 12:59pm UTC](https://community.plotly.com/t/dash-button-not-working/56818/3 "2021-09-21T12:59:23Z")

</div>

oh ,thank you very much.  
It is work
