Obtaining email address via form and do not want to rerun the entire page on submit

Is it possible to not rerun the entire streamlit script when the user enters their email.

st.sidebar.write(st.session_state)
if st.session_state.valid_email==False:
with st.expander(“Provide your email for early access to updates and other alpha!”, expanded=True):
with st.form (“emailform”):
signupemail = st.text_input(‘Please enter your e-mail address’, value=None)
submitted = st.form_submit_button(“Submit”)

   if submitted: #This calls the API for Mailerlite

What is the strategy for doing this?

thanks!

Hi @HornHighYo, you could try this:

  1. Remove the lines:
    a. with st.form

    b. submitted


  2. process your API via the on_change and/or args parameters available for st.text_input. You could refer the docs for more details.

Cheers

Thanks so much @Shawn_Pereira for pointing me in the right direction!!!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.