title: passing text value to ajax function on clicking submit button
body: <p>I have form which consists of a text field (id="txt1")
  and a submit button(id="submit"). Ajax function 'showhint()' is called on 'onclick' event of submit button.</p>
  
  <pre><code>&lt;form action=""&gt;  
  &lt;input type="text" id="txt1"   /&gt;
  &lt;input type="submit" id="submit" onclick="showhint()"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And ajax function</p>
  
  <pre><code>    function showhint(){
  var xmlhttp;
  
  if(window.XMLHttpRequest)
  {
      xmlhttp=new XMLHttpRequest();
  }
  else
  {
      xmllhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  xmlhttp.onreadystatechange=function(){
      if(xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
      {
          document.getElementById("txthint").innerHTML=xmlhttp.responseText;
      }
          }
              xmlhttp.open("GET","gethint.php",true);
              xmlhttp.send();
              }
  </code></pre>
  
  <p>Here gethint.php is page where showhint() function does its work and targeted div to write ajax respone is "txthint" .
  what I want is to pass text value(form's) to ajax function. Is there any easy way?
  Waiting for response, any usefull response would be highly appreciable.
    thaks in adavance</p>