How are you doing that? I have something like:
with st.form("form"):
space_for_selecting_use_case = st.empty()
if use_case == "complex":
additional_input = st.text_input("Additional Input")
with space_for_selecting_use_case:
use_case = st.radio(
label = "Select your use case.",
options = ("simple", "complex")
)
I then get an error of “cannot access local variable ‘use_case’ where it is not associated with a value” when checking if use_case == "complex".
In the provided example, radio_option was only accessed in a different empty element, whose contents were defined after the section initializing radio_option itself. How would you access the value of radio_option in an if-statement in the form itself?