Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(shiny)
- library(shinyjs)
- ui<-shinyUI(
- fluidPage(
- useShinyjs(),
- tags$form(
- class = "form-horizontal", action="/action_page.php",
- div(
- class = 'form-group',
- tags$label(class = 'control-label col-sm-2', `for` = 'month_abb', 'Month (abbr.)'),
- div(
- class = 'col-sm-4',
- selectInput('month_abb', '', month.abb)
- )
- ),
- div(
- class = 'form-group',
- tags$label(class = 'control-label col-sm-2', `for` = 'month_full', 'Month (full)'),
- div(
- class = 'col-sm-4',
- selectInput('month_full', '', month.name)
- )
- ),
- checkboxInput('abbr', 'Abbreviated')
- )
- )
- )
- server<-function(input, output) {
- observe({
- toggle(selector = "$('#month_full').parent('.form-group')", condition = !input$abbr)
- toggle(selector = "$('#month_abbr').parent('.form-group')", condition = input$abbr)
- })
- }
- shinyApp(ui,server)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement