Form_submit_button doesn't batch update

Hi all,

I’m new to streamlit and am trying the form_submit_button function.
All I have in the app is a slider and a submit button. When I moved to slider, streamlit automatically prints the number without me pressing the submit button.

My expected result is that it would not print any number until I press submit.

For example, when I moved from the slider from 0 to 65, my expected result is 0. I also expect it to print 65 after I click submit.

Does anyone have any pointers on what I could do to fix this?

Streamlit ver: 0.89.0
python: 3.7.9

import pandas as pd
import streamlit as st

with st.form(key=‘my_form’):

with st.sidebar:
  text_input = st.slider(label='Enter some text')
    submit_button = st.form_submit_button(label='Submit')


Hi @Jwing,

That’s quite strange! I wasn’t able to reproduce the issue on my end with the exact same code. Would you mind sharing a GIF/video of your screen displaying this behavior?

When I tried it on my end, the value of text_input was displayed only when submit_button was clicked:

Best, :balloon:

I tried using the recorder but also got another error (see below picture). Currently using firefox 64 bit ver 92.0.1

I also tried opening in Chrome (version 94.0.4606.61) and see the same error for the recorder. I still see that the number changes without me pressing the submit button too.

Not sure if this helps but I also use another python file called to open the server. calls my file which contains the slider. The steps I would do is:

  1. double click to bring up cmd promp
  2. in cmd prompt I copy the server and paste into firefox/chrome
  3. I adjust the slider to see if it prints the number or not without pressing the button


import os
import streamlit.bootstrap
from streamlit import config as _config

dirname = os.path.dirname(file)
filename = os.path.join(dirname, ‘’)

_config.set_option(“server.headless”, True)
args =, ‘’, args, flag_options={})


import pandas as pd
import streamlit as st

with st.form(key=‘my_form’):
with st.sidebar:
text_input = st.slider(label=‘Enter some text’)
submit_button = st.form_submit_button(label=‘Submit’)


Hi snehankekre,

Appreciate the response. After muddling around stackoverflow and streamlit forums I found the reasoning for the error and a solution. Turns out, streamlit.bootstrap breaks forums (you can see my ‘’ script in this thread).

I realized that by running this directly into cmd prompt doesnt break the form compared to executing my script. My solution was using this script below to run streamlit. Form works as intended now!

import sys
from streamlit import cli as stcli

if name == ‘main’:
sys.argv = [“streamlit”, “run”, “”]