Set/reset selectbox value

Hi @elwyn ,

Will this work for you ?

import streamlit as st

emp = st.empty()
transport = emp.text_input('Transport', 0)
# Probably you don't need slider, just to show that the value can be variable user Input
val = st.slider(label = 'Transport value',min_value= 1,max_value = 20 )

if st.button('Set transport to 10'):
    # Insted of val, just plug in 10, if exactly that's what you need
    transport = emp.text_input('Transport', val)

Best,
Avra

1 Like