title: function not getting new value from input field unless page is refreshesd
body: <p>I have some dynamically created input fields that allow the user to run multiple queries at once. The issue when I enter a search term into a field it works the first time and returns the relevant data but if I enter a different search term and run the search again my function does not research with the new term in the input field. I have to refresh the page to run a different search. Here is the code that retrieves the search term. </p>
  
  <pre><code>var searchTerms = [];
  
  function getSearchTerm() {
    $(".buttonshowHide").show();
    for (i=0; i&lt;searchBoxes; ++i) {
      var searchTerm=document.getElementById("gearInput" + i).value;
      searchTerms.push(searchTerm);
    }
      makeBtnLabels();
      buildRequestUrl();
  };
  </code></pre>
  
  <p>The getSearchTerm function is triggered by pressing an html search button. </p>