Dynamic checkboxes and dropdowns within a form without clicking on submit button

Hello,

I am developing a Streamlit application which has few dropdowns. For one of the dropdowns, based on the option selected few UI componets like checkboxes and multiselect boxes have to be created within the form, on the fly.

I am using a form currently to embed UI components, however I am unable to create UI components dynamically as I do not get the form data until it is submitted. Is there a way, how I can get the slections made and create ui components dynamically? Or is there any other way to tackle the issue?

Looking forward for suggestions.

Many Thanks,
Latha

Hi @Latha,

Thanks for posting!

Rather than using a form, you might want to use a combination of individual input widgets and session state. Once a user interacts with the widget, you can then add the other widgets and store the new values in session state if needed.

Hope this helps!

Caroline :balloon: