title: Ajax responds with empty string when triggered via form onsubmit in Firefox, but working fine in Internet Explorer
body: <p>Ajax responds with an empty string when triggered via form <code>onsubmit</code> in Firefox, but it is working fine in Internet Explorer and Opera (works in Firefox if sent by a submit button instead of form <code>onsubmit</code>).</p>
  
  <p>I am simply calling a php file with the ajax GET and the php file response with - <code>echo $response = "something";</code>.  Then the response value is alerted. I am getting it work in IE but in Firefox the response is an empty string (checked by <code>typeof()</code>).</p>
  
  <p>code is 4 files: index.php, ajax-connect.js, cbb.js, cbb.php</p>
  
  <p><strong>index.php</strong></p>
  
  <pre><code>&lt;html&gt; &lt;head&gt;  &lt;script src="ajax-connect.js"&gt;&lt;/script&gt; &lt;script src="cbb.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt; &lt;body&gt;
  
  &lt;form name="condtactform1" method="get" action="" onSubmit="contactfunction()"&gt;
      &lt;input type="submit" name="hissubmit" id="hissubmit" value="submit"&gt; &lt;/form&gt;
  
  &lt;/body&gt; &lt;/html&gt;
  </code></pre>
  
  <p><strong>ajax-connect.php</strong></p>
  
  <pre><code>/* Create a new XMLHttpRequest object to talk to the Web server */
  
  var xmlHttp = false;
  /*@cc_on @*/
  /*@
  if (@_jscript_version &gt;= 5)
      try {
         xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
          try {
              xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (e2) {
              xmlHttp = false;
          }
      }
  @end
  @*/
  
  
  if (!xmlHttp &amp;&amp; typeof XMLHttpRequest != 'undefined') {
     xmlHttp = new XMLHttpRequest();
  }
  </code></pre>
  
  <p><strong>cbb.js</strong></p>
  
  <pre><code>function contactfunction() {
     var url = "cbb.php";
     xmlHttp.open("GET", url, true);
     xmlHttp.onreadystatechange = updatecontact1;
     xmlHttp.send(null);
  }
  
  function updatecontact1() {
     if (xmlHttp.readyState == 4) {
         var responsae = xmlHttp.responseText;
         alert(responsae);
     }
  }
  </code></pre>
  
  <p><strong>cbb.php</strong></p>
  
  <pre><code>&lt;?php $response = "something"; echo $response; ?&gt;
  </code></pre>
  
  <p>If i trigger ajax by submit button instead of the form submit then it works fine in firefox like:</p>
  
  <pre><code>&lt;form name="condtactform1" method="get" action=""&gt;
      &lt;input type="submit" name="hissubmit" id="hissubmit" value="submit" onFocus="contactfunction()"&gt; &lt;/form&gt;
  </code></pre>
  
  <p>Any idea why it is doing this? </p>
  
  <p>Thanks.</p>