Refer streamlit widget object after its declaration

My question is very strraight ,

let us say i declare streamlit Dropdownbox like this, in the begining its disabled
SelectDB= st.selectbox(" Select The Database",disabled=True)

Later on during 2nd Refresh i would like to enable this Selectbox , how do i refer this widget element at the 2nd refresh time to enable this widget.

You don’t. Instead you make sure the right value for disabled is used in the function call. For example:

disabled = st.checkbox("Disable selectbox")
SelectDB = st.selectbox("Select The Database", options=["DB1", "DB2"], disabled=disabled)
1 Like

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