Environment: Mac/M1, chrome, streamlit 0.85.1
with st.form(key="update_status"):
selected_code = st.selectbox('select code', df["code"].tolist())
selected_status = st.selectbox('select status', status)
btn = st.form_submit_button('submit')
print(btn)
if not btn:
submit_status(selected_code, selected_status)
I found two issues not complied with the document:
- if I use “on_click” to call submit function, two select values can’t be updated
- if I use return value of submit button to call it, return bool value is oppsite to common sense. Only like my code, the evnent to click button can be invoked.
I don’t understand how to create a form in streamlit acting like other web forms. Is it because of document or bugs in code?