title: how to pass two values or arguments from two dropdown to ajax?
body: <p><strong>index.php</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;script&gt;
              function showUser(str,str1) {
                  if (str=="") {
                      document.getElementById("txtHint").innerHTML="";
                      return;
                  }
                  if (window.XMLHttpRequest) {
                      // code for IE7+, Firefox, Chrome, Opera, Safari
                      xmlhttp=new XMLHttpRequest();
                  }
                  else {
                      // code for IE6, IE5
                      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                  }
                  xmlhttp.onreadystatechange=function() {
                      if (this.readyState==4 &amp;&amp; this.status==200) {
                          document.getElementById("txtHint").innerHTML=this.responseText;
                      }
                  }
                  xmlhttp.open("GET","getdata.php?q="+str+"&amp;s="+str1,true);
                  xmlhttp.send();
              }
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form&gt;
              &lt;select name="users" onchange="showUser(this.value)"&gt;
                  &lt;option value="0"&gt;Select a person:&lt;/option&gt;
                  &lt;option value="1"&gt;Peter Griffin&lt;/option&gt;
                  &lt;option value="2"&gt;Lois Griffin&lt;/option&gt;
                  &lt;option value="3"&gt;Joseph Swanson&lt;/option&gt;
                  &lt;option value="4"&gt;Glenn Quagmire&lt;/option&gt;
              &lt;/select&gt;
              &lt;select name="users2" onchange="showUser(this.value)"&gt;
                  &lt;option value="0"&gt;Select a person:&lt;/option&gt;
                  &lt;option value="5"&gt;Peter Griffin&lt;/option&gt;
                  &lt;option value="6"&gt;Lois Griffin&lt;/option&gt;
                  &lt;option value="7"&gt;Joseph Swanson&lt;/option&gt;
                  &lt;option value="8"&gt;Glenn Quagmire&lt;/option&gt;
              &lt;/select&gt;
          &lt;/form&gt;
          &lt;br&gt;
          &lt;div id="txtHint"&gt;
              &lt;b&gt;
                  Person info will be listed here.
              &lt;/b&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>From this HTML page i want to pass two values to one ajax function but it can't pass value from second dropdown. But from first dropdown which is with name 'users' pass value fine to ajax but from 2nd dropdown it cant pass value to ajax function</p>
  
  <p>Below check getdata.php
  <strong>getdata.php</strong></p>
  
  <pre><code>&lt;?php
  echo "ab";  
  echo $_GET['s'];
  if($_GET['q']==1)
  {
      echo "7";
  }
  if($_GET['q']==2)
  {
      echo "2";
  }
  if($_GET['q']==3)
  {
      echo "3";
  }
  if($_GET['s']==7)
  {
      echo "4";
  }
  ?&gt;
  </code></pre>