title: R Shiny - make input reactive to other input on page, but the main function reactive to submit button
body: <p>I have a shiny app where the user selects two date ranges, and a submit button
  The first date range is for the analysis period, while the second date range is a range that should fall <strong>within the first date range</strong>.</p>
  
  <p>I'm using dateRangeInput, and I want to set the min and max date for the second dateRangeInput equal to the user-selected time period from the first dateRangeInput. My problem right now is that the way I have it set up right now, <strong>the second dateRangeInput doesn't refresh until the user hits submit, whereas I'd like it to refresh as soon as the first dateRangeInput changes.</strong></p>
  
  <p>How do I achieve this?</p>
  
  <p>So far my code looks like this:</p>
  
  <pre><code>#ui.R
  shinyUI(fluidPage(
      sidebarLayout(
        sidebarPanel(
          dateRangeInput('inputDate', 'Select date range for analysis period', start = '2015-07-01', end = '2015-07-03', min = min_date, max = max_date),
      #the output below is refreshing only when the user hits submit, but I would like it to refresh as soon as the first dateRangeInput changes.
      uiOutput('return_dates'),
      submitButton("Submit")
    ),
        mainPanel()
  )))
  
  #server.R
  shinyServer(function(input, output, session) {
    ret_min &lt;- reactive({
      input$inputDate[1]
    })
  
    ret_max &lt;- reactive({
      input$inputDate[2]
    })
    output$return_dates &lt;- renderUI({
        dateRangeInput('inputDate2', 'Select date range for return period', start = '2015-07-01', end = '2015-07-02', min = ret_min(), max = ret_max())
      })
    analysisFunction &lt;- reactive({
        #code here performs analysis based on the given date range, and should run only when the user hits submit
      })
  })
  </code></pre>