title: Change input text value in before submitting form
body: <p>I'm trying to change the value of my input text field before submitting the form using jQuery like this:</p>
  
  <pre><code>&lt;form actions="http://test.com/" method="GET"&gt;
   &lt;input name="test" id="autocompleteform" type="text"/&gt;
  &lt;/form&gt;
  &lt;script&gt;
  $('#form-customer-attr-new').submit(function(e) {
      var value = $("#autocompleteform").val();
      value = value.substr(0, value.indexOf(' '));
      if (!isNan(value) &amp;&amp; !empty(value)) {
          $("#autocompleteform").val(value);
          alert($("#autocompleteform").val());
          return true;
      } else {
          alert("Invalid Postcode");
          return false;
      }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>when i alert the value of the input file, it's showing the new value, but when the form submitten, the paramether in url still showing the old value of the input, for example:</p>
  
  <pre><code> old_input_value = "1234 justice spoiler message";
   new_input_value = "1234";
   the_url_after_form_submit_now = "http://test.com?test=1234+justice+spoiler+message";
   the_url_after_form_submit_should_be ="http://test.com?test=1234";
  </code></pre>