title: jQuery submit() and form action not working
body: <p>I have a simple search field:</p>
  
  <pre><code>  &lt;form id="searchForm" action=""&gt;
      &lt;input type="text" name="searchField" id="searchField" value=""&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>I've tried several variations of this (<a href="https://stackoverflow.com/questions/2675580/jquery-dynamically-build-form-action-on-submit">related link</a>):</p>
  
  <pre><code>&lt;script&gt;
    $('#searchField').keypress(function (e) {
      if (e.which == 13) {    // hit enter
        $('#searchForm').submit(function(){
            var val = $('#searchField').val();
            this.action = "index.php?g="+genre+"&amp;s="+val; 
            return false;
        });
      }
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>&lt;script&gt;
    $('#searchField').keypress(function (e) {
      if (e.which == 13) {    // hit enter
        var val = $('#searchField').val();
        $('#searchForm').attr("action","index.php?g="+genre+"&amp;s="+val);
        $('#searchForm').submit();
        return false;
      }
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>But am unable to get the page (action) to direct to the desired page. Even if I try and set the action externally (eg: Google.com), it will not send me there. What am I missing? The genre var is declared previously btw.</p>
  
  <p>Also, I know it needs validation - just trying to get it working first.</p>
  
  <p>Thanks</p>