Form_submit_button error when deployed to RStudio Connect

I have the following code:

import streamlit as st

with st.form('Select Pools to Compare'):
    col1, col2 = st.columns(2)
    with col1:
        st.subheader('Pool 1')
        pool1_start = st.number_input('Pool 1 Start', step=1, value=2)
        pool1_end = st.number_input('Pool 1 End', step=1, value=8)
    with col2:
        st.subheader('Pool 2')
        pool2_start = st.number_input('Pool 2 Start', step=1, value=4)
        pool2_end = st.number_input('Pool 2 End', step=1, value=10)
    
    submitted = st.form_submit_button('Submit')
    
if submitted:
    st.write('Pool 1 Start', pool1_start, 'Pool 1 End', pool1_end)
    st.write('Pool 2 Start', pool2_start, 'Pool 2 End', pool2_end)

When I deploy this script locally, it works as expected. (Writes the two lines outside of the form when the form submit button is pressed). However, when I deploy this same code to RStudio-Connect, I get an error stating, โ€œMissing Submit Buttonโ€.

Any idea why this is happening? Or experience of getting form submit buttons to work on RStudio-Connect?

Thanks in advance!

Hi @Lowspin, welcome back to the community!

In the past, RStudio Cloud has specified a specific version of Streamlit to be run, which was behind the most currently released version. I would check that first, to see if they are running a version prior to having the forms/submit button release.

Best,
Randy

@randyzwitch Thanks! Glad to be here!

Checking RStudio environment it says it is running streamlit=1.1.0. Which should be compatible with the form button.

If RStudio Cloud were running an older version of streamlit, would it even give the error that the form is missing a form_submit_button()?

Probably not, but I like to start at the most obvious place, especially on a system that we donโ€™t control.

Iโ€™ve also run this locally and can confirm it works correctly. Unfortunately, I donโ€™t have access to RStudio Cloud, so I donโ€™t know what else to suggest.

Best,
Randy

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