Spaces:
Sleeping
Sleeping
import streamlit as st | |
if __name__ == "__main__": | |
if 'check_dict' not in st.session_state: | |
st.session_state.check_dict = {'check1': False, 'check2': False, 'check3': False} | |
with st.form('my_form'): | |
st.session_state.check_dict['check1'] = st.checkbox('Check 1 out') | |
st.session_state.check_dict['check2'] = st.checkbox('Check 2 out') | |
st.session_state.check_dict['check3'] = st.checkbox('Check 3 out') | |
check21 = st.checkbox('Check 21 out') | |
if check21: | |
st.write('check21 is checked') | |
check22 = st.checkbox('Check 22 out') | |
if check22: | |
st.write('check22 is checked') | |
check23 = st.checkbox('Check 23 out') | |
if check23: | |
st.write('check23 is checked') | |
# Every form must have a submit button. | |
submitted = st.form_submit_button('Submit') | |
for key, value in st.session_state.check_dict.items(): | |
st.write(key, value) |