Hi guys,
Quick q - Is it possible to display a slider only if its related tick box is ticked?
I’ve tried a few things including the code in the screenshot below
I can’t seem to make that work, hopefully this is possible!
Thanks,
Charly
Hi guys,
Quick q - Is it possible to display a slider only if its related tick box is ticked?
I’ve tried a few things including the code in the screenshot below
I can’t seem to make that work, hopefully this is possible!
Thanks,
Charly
hi @Charly_Wargnier, when you say it doesn’t work, you mean the slider isn’t appearing?
Could you share some sample code that I can copy/paste and run to reproduce the issue?
Thanks Jonathan.
I’ve worked out the issue – pasting the working code below
import streamlit as st
st.title("Check Boxes")
check_box_1 = st.checkbox("Partial ratio")
check_box_2 = st.checkbox("Token sort ratio", value=True)
st.title("Sliders")
if check_box_1 == True:
Partial_ratio_slider = st.slider('partial ratio values')
if check_box_2 == True:
Token_sort_slider = st.slider('token sort ratio values')
Charly
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.