I am very new in Shiny and I am sorry if my question seems obvious. I would be very grateful for any help on the matter.
I use checkboxGroupInput
with multiple choice (e.g. days of week) and I need options to appear for each tick (e. g. hours).
I tried to add conditionalPanel
for each option. But this only works if only one box is ticked. If two or more boxes are ticked, no option is shown.
Moreover the conditional options appear at the bottom of all the checkboxGroupInput
block.
Ideally, I would like the options of checkboxGroupInput
to appear vertically (wihich is the default) and for each ticked option, a selectInput
(or equivalently a checkboxGroupInput
) appears on the right side of the ticked option with the conditional value.
I hope my question is clear enough and that it is not too difficult to implement!
Thanks a lot for any help :-)
shinyApp(
ui = fluidPage(
titlePanel("Week and time"),
div(
id = "form",
checkboxGroupInput("days", "Days of week",
c("Monday", "Tuesday", "Wenesday")),
conditionalPanel(condition = "input.days == 'Monday'",
selectInput("time",
"Hours to choose Monday",
c("8h00", "9h00"))),
conditionalPanel(condition = "input.days == 'Tuesday'",
selectInput("time",
"Hours to choose Tuesday",
c("8h00", "9h00"))),
actionButton("submit", "Submit", class = "btn-primary")
)
),
server = function(input, output, session) {
}
)