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.

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?


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.


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