You can specify a list of tags tagList . The tags you need are option tags with value attributes. You can build them using mapply
library(shiny) runApp(list( ui = bootstrapPage( numericInput('n', 'Enter 3 for condition', 3, 0, 10), conditionalPanel(condition="input.n==3", div(style="display:inline-block", tags$label('Menu1', `for` = 'Sample'), tags$select(id = 'Sample', class="input-small", tagList(mapply(tags$option, value = 1:10, paste0(letters[1:10], 1:10), SIMPLIFY=FALSE))) ), div(style="display:inline-block", tags$label('Menu2', `for` = 'Sample1'), tags$select(id = 'Sample1', class="input-small", tagList(mapply(tags$option, value = 1:2, paste0(letters[1:2], 1:2), SIMPLIFY=FALSE))) ) ) , textOutput("cond") ), server = function(input, output) { output$cond <- renderText({ if(input$n == 3){ paste0("Sample value selected =", input$Sample, " Sample1 value selected =",input$Sample1) } }) } ))
Of course, you can just use selectInput inside the div , for example:
library(shiny) runApp(list( ui = bootstrapPage( numericInput('n', 'Enter 3 for condition', 3, 0, 10), conditionalPanel(condition="input.n==3", div(style="display:inline-block", selectInput("Sample", "Choose you Input:", choices = c('a1'='1','b2'='2')) ), div(style="display:inline-block", tags$label('Menu2', `for` = 'Sample1'), tags$select(id = 'Sample1', class="input-small", tagList(mapply(tags$option, value = 1:2, paste0(letters[1:2], 1:2), SIMPLIFY=FALSE))) ) ) , textOutput("cond") ), server = function(input, output) { output$cond <- renderText({ if(input$n == 3){ paste0("Sample value selected =", input$Sample, " Sample1 value selected =",input$Sample1) } }) } ))