title: Get inputs from Shiny UI app to the server on Submit or Action button
body: <p>I have 15 select (input type) fields. And I need to pass it to the Server function do prediction and show resultant output. <strong>I don't want to auto-update</strong>, when user sets value for one input field, but instead I want user to set values for all (15 input fields) and then press some type of a button to get the output.</p>
  <p>how to achieve that? this is my first shiny UI application.</p>
  <h1>myCode</h1>
  <pre><code>library(shiny)
  
  dataset &lt;- diamonds
  marks &lt;- 0:100
  grades &lt;- c(&quot;A&quot;,&quot;B&quot;,&quot;C&quot;,&quot;D&quot;,&quot;E&quot;,&quot;F&quot;)
  
  ui &lt;- fluidPage(
    
    tags$head(tags$style(HTML(&quot;
                              h2 {
                              text-align: center;
                              }
                              h3 {
                              text-align: center;
                              }
                              h6 {
                              text-align: center;
                              color:red;
                              }
                              #goButton
                              {
                              width: 100%;
                              }
                              &quot;)
                        )
              ),
    
    verticalLayout
    (
      wellPanel
      (
        titlePanel(&quot;Get Recommendation for Year 4 or 5 Courses&quot;),
        h6(&quot;* Set the value of input field as 'NA', if you received a remark of Absent (ABS), Medical Circumstances (MC), Exemption (EX), Synoptic Course in absence (NC), Discretionary credits (DC), or any other reason&quot;)
      )
      
    ),
     
    fluidRow
    (
      column(2,
             wellPanel(
                  radioButtons(&quot;type&quot;, label = h3(&quot;Select Type&quot;),
                  choices = list(&quot;Grades&quot; = 'grades', &quot;Marks&quot; = 'marks'), 
                  selected = 'grades')
                      )
            ),
  
  conditionalPanel
  (
    condition = &quot;input.type == 'grades'&quot;, 
    
    column
    (2, 
      wellPanel
      (
             h3(&quot;Year 1&quot;),
             selectInput('a', 'A',c('NA', grades)),
             selectInput('b', 'B',c('NA', grades)),
             selectInput('c', 'C',c('NA', grades)),
             selectInput('d', 'D',c('NA', grades)),
             selectInput('e', 'E',c('NA', grades))
      )
    ),
    column
    (2,
      wellPanel
      (
             h3(&quot;Year 2&quot;),
             selectInput('f', 'F',c('NA', grades)),
             selectInput('g', 'G',c('NA', grades)),
             selectInput('h', 'H',c('NA', grades)),
             selectInput('i', 'I',c('NA', grades)),
             selectInput('j', 'J',c('NA', grades))
      )
    ),
    column
    (2,
      wellPanel
      (
             h3(&quot;Year 3&quot;),
             selectInput('k', 'K',c('NA', grades)),
             selectInput('l', 'L',c('NA', grades)),
             selectInput('m', 'M',c('NA', grades)),
             selectInput('n', 'N',c('NA', grades)),
             selectInput('o', 'O',c('NA', grades))
      )
    )
  ),
  
  conditionalPanel
  (
    condition = &quot;input.type == 'marks'&quot;, 
    column
    (2, 
     wellPanel
      (
             h3(&quot;Year 1&quot;),
             selectInput('a', 'A',c('NA', marks)),
             selectInput('b', 'B',c('NA', marks)),
             selectInput('c', 'C',c('NA', marks)),
             selectInput('d', 'D',c('NA', marks)),
             selectInput('e', 'E',c('NA', marks))
      )
    ),
    
    column
    (2,
     wellPanel
      (
             h3(&quot;Year 2&quot;),
             selectInput('f', 'F',c('NA', marks)),
             selectInput('g', 'G',c('NA', marks)),
             selectInput('h', 'H',c('NA', marks)),
             selectInput('i', 'I',c('NA', marks)),
             selectInput('j', 'J',c('NA', marks))
      )
    ),
    
    column
    (2,
     wellPanel
      (
             h3(&quot;Year 3&quot;),
             selectInput('k', 'K',c('NA', marks)),
             selectInput('l', 'L',c('NA', marks)),
             selectInput('m', 'M',c('NA', marks)),
             selectInput('n', 'N',c('NA', marks)),
             selectInput('o', 'O',c('NA', marks))
      )
    )
  ),  
  column
  (4,
   actionButton(&quot;goButton&quot;, &quot;Submit&quot;),
   wellPanel
    (
      h3(&quot;Results&quot;),    
      verbatimTextOutput(&quot;value&quot;)
    )
  )
    )
  )
  
  server &lt;- function(input, output) 
  {
    #Do Prediction
    #Get Results
    new_vector = c()
  
  if (input.type == 'marks'){
  new_vector &lt;- append(new_vector, input$f27sa, 1)
  new_vector &lt;- append(new_vector, input$f27sb, 2)
  new_vector &lt;- append(new_vector, input$f27cs, 3)
  new_vector &lt;- append(new_vector, input$f27is, 4)
  new_vector &lt;- append(new_vector, input$f27px, 5)
  
  new_vector &lt;- append(new_vector, input$f28in, 6)
  new_vector &lt;- append(new_vector, input$f28da, 7)
  new_vector &lt;- append(new_vector, input$f28pl, 8)
  new_vector &lt;- append(new_vector, input$f28sd, 9)
  new_vector &lt;- append(new_vector, input$f28dm, 10)
  
  new_vector &lt;- append(new_vector, input$f28ai, 11)
  new_vector &lt;- append(new_vector, input$f28fa, 12)
  new_vector &lt;- append(new_vector, input$f28fb, 13)
  new_vector &lt;- append(new_vector, input$f28oc, 14)
  new_vector &lt;- append(new_vector, input$f28pd, 15)
  }else{
  
  new_vector &lt;- append(new_vector, input$f27sa2, 1)
  new_vector &lt;- append(new_vector, input$f27sb2, 2)
  new_vector &lt;- append(new_vector, input$f27cs2, 3)
  new_vector &lt;- append(new_vector, input$f27is2, 4)
  new_vector &lt;- append(new_vector, input$f27px2, 5)
  
  new_vector &lt;- append(new_vector, input$f28in2, 6)
  new_vector &lt;- append(new_vector, input$f28da2, 7)
  new_vector &lt;- append(new_vector, input$f28pl2, 8)
  new_vector &lt;- append(new_vector, input$f28sd2, 9)
  new_vector &lt;- append(new_vector, input$f28dm2, 10)
  
  new_vector &lt;- append(new_vector, input$f28ai2, 11)
  new_vector &lt;- append(new_vector, input$f28fa2, 12)
  new_vector &lt;- append(new_vector, input$f28fb2, 13)
  new_vector &lt;- append(new_vector, input$f28oc2, 14)
  new_vector &lt;- append(new_vector, input$f28pd2, 15)
  }
  results &lt;- eventReactive(input$goButton,{
  
  return (new_vector)
  
  })
  output$value &lt;- renderPrint({ results() })
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/LTi8R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LTi8R.png" alt="snapshot of shiny UI App" /></a></p>