title: PHP get value of texbox on update and store to php variable without refreshing page or clicking button
body: <p>I currently have a HTML form where the user will select an Aircraft from a dropdown. What I want to be able to do is then get the value for what they have selected and store it to a variable to then be able to do a select query from the database to select all the info for that aircraft without them having to click a button or refresh the page. I currently have it so that on update it is writing the value to a hidden texbox using java but from what I can tell I cannot find a way to then store this to PHP as one is client side and the other is server side. </p>
  
  <p>The following is the dropdown and hidden texbox:</p>
  
  <pre><code>&lt;select id="ac"&gt;
       &lt;option&gt;-- Select --&lt;/option&gt;
       &lt;?php while ($row1 = mysqli_fetch_array($result5)):;?&gt;
       &lt;option value = "&lt;?php echo $row1['Rego'] ?&gt;"&gt;&lt;?php echo 
       $row1['Rego'] ?&gt;&lt;/option&gt;
       &lt;?php endwhile; ?&gt;
  &lt;/select&gt;
  
  &lt;input type="text" name="hidden" id="hide"&gt;
  </code></pre>
  
  <p>This is the Javascript for the on update</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          $(document).ready(function() {
              $('#ac').on('change', function() {
                  var aircraft = $(this).val();
                  document.getElementById('hide').value = aircraft;
              });
          });
  &lt;/script&gt;
  </code></pre>
  
  <p>I want to be able to have the var aircraft stored to a variable I can then use in a MySQL select query such as SELECT * FROM Aircraft WHERE Rego = VARIABLE</p>