title: How to validate multiple numeric inputs in Shiny and display an error message?
body: <p>I have 3 numeric inputs in a Shiny app. These are percentages with a min and max threshold. Obviously the sum should not be greater than 100.  </p>
  
  <p>How can I add an error message or notification when the sum of the 3 inputs in greater than 100?</p>
  
  <p>Code below:</p>
  
  <pre><code>library(shiny)
  
  # Define the UI
  ui &lt;- bootstrapPage(
    numericInput('s1', 'Share 1 (%):', 30, min = 5, max = 55),
    numericInput('s2', 'Share 2 (%):', 30, min = 5, max = 55),
    numericInput('s3', 'Share 3 (%):', 40, min = 5, max = 55),
  
    textOutput('result')
  )
  
  
  # Define the server code
  server &lt;- function(input, output) {
    output$result &lt;- renderText({
      (input$s1 + input$s2 + input$s3)
    })
  }
  
  
  # Return a Shiny app object
  shinyApp(ui = ui, server = server)
  </code></pre>