Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ with st.form("user_form"):
|
|
16 |
|
17 |
# Add form buttons
|
18 |
submit_button = st.form_submit_button("Submit")
|
19 |
-
clear_button = st.form_submit_button("Clear")
|
20 |
|
21 |
# Handle form submission
|
22 |
if submit_button:
|
@@ -26,10 +26,5 @@ if submit_button:
|
|
26 |
else:
|
27 |
st.error("Please enter your name.")
|
28 |
|
29 |
-
# Handle form clearing
|
30 |
-
if clear_button:
|
31 |
-
# Re-run the app to reset the form
|
32 |
-
st.experimental_rerun()
|
33 |
-
|
34 |
# Display an image
|
35 |
st.image("./nadi-lok-image.png", caption="Image")
|
|
|
16 |
|
17 |
# Add form buttons
|
18 |
submit_button = st.form_submit_button("Submit")
|
19 |
+
clear_button = st.form_submit_button("Clear",on_click=clear_form)
|
20 |
|
21 |
# Handle form submission
|
22 |
if submit_button:
|
|
|
26 |
else:
|
27 |
st.error("Please enter your name.")
|
28 |
|
|
|
|
|
|
|
|
|
|
|
29 |
# Display an image
|
30 |
st.image("./nadi-lok-image.png", caption="Image")
|