def main():
st.title("Guess name")
release_name_form = st.form(key="Input name")
name = release_name_form.text_input("Name", "")
guess_clicked = release_name_form.form_submit_button("Guess Data")
if guess_clicked:
with st.form(key="test"):
col1, col2 = st.columns(2)
col1.text_input("Firstname", name.split()[0])
col2.text_input("Lastname", name.split()[-1])
submit = st.form_submit_button("Submit")
Hi wrote a simple program to type in a full name and then use split to display first and last name using text input so users can edit it and submit it
Lets say a user changed the data in the col1
aka Firstname
field unintentionally.
When the user clicks guess Data
/ guess_clicked
button the st.form(key="test")
fields don’t refresh
only when the data in release_name_form = st.form(key="Input name")
changes the second form re renders
how can I get the second form to re render on the guess_clicked
button click ?