How to use global variables in strealit

HI,
i have this code :

with st.container(key="body-custom-chart"):
     col1, col2= st.columns(2)
     with col1:
            st.write(selectedDate )
      with col2:
            selectedDate = st.date_input("rrr", format="DD/MM/YYYY",label_visibility="collapsed",on_change=hideDATEselector(),key="datep1")

my question is : How I can st.write the selectedDate in the col1 where I changed in the col2 ?

thnaks

Just grab the selected date before writing it.

with st.container(key="body-custom-chart"):
    col1, col2= st.columns(2)
    with col2:
        selectedDate = st.date_input("rrr", format="DD/MM/YYYY",label_visibility="collapsed",on_change=hideDATEselector(),key="datep1")
    with col1:
        st.write(selectedDate )
1 Like

let me try please

it works.thanks