title: Interactively change the selectInput choices
body: <p>Originally I create this shiny interface that takes in a parameter "company id" and "date", but here we have a problem: most people dont know the companies we work with by their id, only their name, i.e. (McDonalds, Radioshack). </p>
  
  <p>So I want to ideally create a search function like this 
  <img src="https://i.stack.imgur.com/qkTxb.jpg" alt="enter image description here"></p>
  
  <p>My current idea is to pass in a table including a list of all our partner companies and their ids to global.R.   Then pass in the textInput as the search variables and perform the search on server side. However, I get lost on how to pass searchResults back into the UI on a selectInput panel? </p>
  
  <p>My current code: </p>
  
  <p>ui.R</p>
  
  <pre><code>library(shiny)
  
  shinyUI(pageWithSidebar(
  
  
    sidebarPanel(
  
      textInput("nameSearch", "Or, Search for company name", 'McDonald'),
      selectInput("partnerName", "Select your choice", list( "searchResults" ),
      br(),
      submitButton("Update View"),
      br(),
  
    ),
  </code></pre>
  
  <p>server.R</p>
  
  <pre><code>  shinyServer(function(input, output) {
  
    #subTable
    searchResult&lt;- reactive({
      subset(partners, grepl(input$nameSearch, partners$name))
    })
  
    output$searchResults &lt;- renderTable({ 
      searchResult[,1]
      })
  </code></pre>
  
  <p>global.R</p>
  
  <pre><code>partners&lt;- read.csv("partnersList.csv", fill=TRUE)
  </code></pre>
  
  <p>partnersList is just in this format</p>
  
  <pre><code>    name            id 
   ------------------
      McDonalds        1
      Wendy's          2
      Bestbuy          3 
  </code></pre>