title: shiny bsModal close button
body: <p>I have a actionButton called Ok. When user clicks this button, it will take the input from a textInput box and show a bsModal message dialog window with some message.</p>
  
  <p>This is the code:</p>
  
  <pre><code>library(shiny)
  library(shinydashboard)
  
  ui &lt;- dashboardPage(
    dashboardHeader(),
    dashboardSidebar(
  
      textInput("text", "Enter Id:"),
      box(width = 1, background  = 'purple'),
      actionButton("Ok", "Press Ok",style='padding:8px; font-size:100%')
    ),
  
    dashboardBody(
  
      bsModal("modalnew", "Greetings", "Ok", size = "small",
              textOutput("text1")
      )
  
      )
    )
  
  server &lt;- function(input, output) { 
  
    observeEvent(input$Ok,{
  
      patid1 &lt;- as.numeric(input$text)
      print(patid1)
  
  
  
      if (is.na(patid1) == TRUE) { output$text1 &lt;- renderText("Please enter 
      a valid ID# without alphabets or special characters")} else {
  
        #output$text1 &lt;-renderText("")
        output$text1 &lt;-renderText({paste("You enetered", patid1)})
      }
  
    })
  
  }
  
  shinyApp(ui, server)
  </code></pre>
  
  <p>What I am trying to do is when the user clicks on <code>Close</code> button on the bsModal window, it should clear the text in the <code>textInput</code> text box. I have no idea how to add a reactive function on the close button in the bsModal message window. Any help is much appreciated.</p>