title: Writing Error Messages For Shiny UI With validate()
body: <p>I would like to create a Shiny UI with 3 checkboxes for the user to choose from. However, I want to prompt the user with an error message if none of the boxes are selected. </p>
  
  <p>I have tried using the validate function to solve this (as shown below) but it's currently not working. Can anyone point out what's wrong with my code and show me how to resolve it?</p>
  
  <pre><code>shinyUI(fluidPage(sidebarLayout(
    sidebarPanel(checkboxGroupInput(
      "variable", "Select An Option:",
      c(
        "One",
        "Two",
        "Three"
      )
    )),
  
    mainPanel(textOutput("text"))
  )))
  
  shinyServer(function(input, output) {
    text.data &lt;- reactive({
      validate(need(!is.null(input$variable),
    "Please select an option"))
      print(input$variable)
    })
    output$text &lt;- renderPrint({
      print(text.data())
    })
  })
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have included images of the results I'm getting below:</p>
  
  <ul>
  <li>When nothing is selected, the message displayed in "NULL NULL" instead of "Please select an option"</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/XXSSs.png" rel="noreferrer"><img src="https://i.stack.imgur.com/XXSSs.png" alt="enter image description here"></a></p>
  
  <ul>
  <li>When a box is selected, this error message is displayed: "Error:is.character(txt) is not TRUE" instead of the a print out of the input selected. </li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/GWe5L.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GWe5L.png" alt="enter image description here"></a></p>