title: $_POST Not Showing Current Option
body: <p>My code is meant to take input text and generate an output for it using PHP via AJAX. While <code>$_POST["inputText"]</code> is set <code>$_POST["style"]</code> isn't set. How can I modify my code to set <code>$_POST["style"]</code> to the current option (a, b or c)? </p>
  
  <p><code>functions01.php</code> is any generic PHP file that takes <code>$_POST["inputText"]</code> and <code>$_POST["style"]</code> echos out an appropriate output.</p>
  
  <p><strong>foo1.php</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;  
    &lt;body&gt;
   &lt;!-- Input --&gt;
      &lt;div class="form"&gt;
        &lt;form onsubmit="makeRequest(); return false"&gt;
          &lt;input type="text" id="inputText" name="inputText"&gt;
          &lt;select name="style"&gt;
            &lt;option value="a"&gt;A&lt;/option&gt;
            &lt;option value="b"&gt;B&lt;/option&gt;
            &lt;option value="c"&gt;C&lt;/option&gt;
          &lt;/select&gt;
          &lt;input type="submit"&gt;
        &lt;/form&gt;
      &lt;/div&gt;
   
      &lt;br&gt;
      
      &lt;!-- Output --&gt;
      &lt;div class="txtBox"&gt;
        &lt;textarea  id="txtBox"&gt;
        &lt;/textarea&gt;
      &lt;/div&gt;
      
      &lt;!-- AJAX to create output using function01.php file--&gt;
      &lt;script&gt;
          function makeRequest() {
              httpRequest = new XMLHttpRequest();            
              httpRequest.onreadystatechange = function() {               
                  document.getElementById("txtBox").innerHTML = httpRequest.responseText;
              };
              httpRequest.open("POST", "functions01.php", true);
              httpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");
              httpRequest.send("inputText=" + document.getElementById("inputText").value);
          }
          
          //function 
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>