title: Firefox not passing values from an input text field to a javascript function
body: <p>I have a problem with firefox passing information into a javascript function.  The following code works ok on Chrome, Safari and Opera.  It has some issues in IE9 but overall does what it is supposed to.</p>
  
  <p>Firefox however simply ignores the onchange and onclick with the console reporting "query is not defined".  If there is a way around this or a different approach I'd love to know.</p>
  
  <pre><code>&lt;div class="viewstory_controls_content"&gt;
                  Search
                  &lt;input type="text" id="query" onchange="javascript:submitForm('../scripts/php/search.php', 'search_results',query,'main')" name="query"&gt;&lt;/input&gt;
                  &lt;button class="viewstory_search" onclick="javascript:submitForm('../scripts/php/search.php', 'search_results', query, 'main')"&gt;
                      &lt;div class="viewstory_search_content"&gt;
                          Search
                      &lt;/div&gt;
                  &lt;/button&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>submit query:</p>
  
  <pre><code>function submitForm(url, target, term, type) {
      // native XMLHttpRequest object
      term = term.value;
      url = url + "?term=" + term + "&amp;type=" + type;
      alert("url:" + url + "\ntarget:" + target + "\nterm:" + term);
      document.getElementById(target).innerHTML = 'sending...';
      if (window.XMLHttpRequest) {
  
          req = new XMLHttpRequest();
          req.onreadystatechange = function() {
              jahDone(target);
          };
          req.open("GET", url, true);
          req.send(null);
      }
      else if (window.ActiveXObject) {
          req = new ActiveXObject("Microsoft.XMLHTTP");
          if (req) {
              req.onreadystatechange = function() {
                  submitFormDone(target);
              };
              req.open("GET", url, true);
              req.send();
          }
      }
  }​
  </code></pre>