My form variable values disappear. I have the following code to update a new user’s details into a text file:
def SignUp():
st.title(“New User:”)
with st.form(key = “SgFrm”):
unme = st.text_input("User Name: ")
pwd = st.text_input("Password: ")
firm = st.text_input("Company: ")
email = st.text_input("Email Address: ")
vfn1 = st.text_input("Data File Name1: ")
vfn2 = st.text_input("Data File Name2: ")
sbtn = st.form_submit_button("Submit User Information")
if sbtn:
st.sidebar.write(sbtn)
tfl = open("./userconfig.txt", "a")
tfl.write(f"\n{unme},{pwd},{firm},{email},{vfn1},{vfn2}")
tfl.close()
snupbtn = st.sidebar.button(“Sign Up”)
if snupbtn:
SignUp()
lginbtn = st.sidebar.button(“Login”)
if lginbtn:
pass
How do I stop the form variables from reinitializing?