Clear referer of query string before POST of form
<p>I have a form that POSTs to a 3rd-party service for validation and information capture. In the 3rd-party back end, you can specify a URL for errors, and one option is "referring URL".</p>

<p>That's seemingly perfect. User POSTs an invalid form, and the page they are on "reloads" (not really, but that's the impression) with error messages taken from a query string that looks like this:</p>

<pre><code>http://somesite.com/?errorMessages=some%20message~~~some%20other%20message~~~etc
</code></pre>

<p>I parse out the separate error messages and push them into a DIV that advises the user what has gone wrong. So far so good.</p>

<p>However, the user continues to screw up the form, and when they POST again, the referrer is now the entire URL including the error messages. The server replies with the original error messages (it's the referrer, after all!) as well as any remaining issues:</p>

<pre><code>http://somesite.com/?errorMessages=some%20message~~~some%20other%20message~~~etc&amp;errorMessages=new%20message~~~another%20new%20message~~~etc
</code></pre>

<p>You can see the issue(s), but to be clear:</p>

<ol>
<li>The form is long enough to begin with; these unchecked appends eventually cause the query string to exceed browser limitations and you get errors.</li>
<li>The parse algorithm isn't reporting back only the latest problems. It's still reporting the original problems, too.</li>
</ol>

<p><em>phew</em></p>

<p><strong>That's a long backstory for a simple question:</strong></p>

<p>In the submit event, is there a way to clear the query string from the referring URL using JavaScript? I don't want to do any referrer spoofing or avoid any legitimate security concerns, I just want to be able to send the "true" referring page minus the query string.</p>

<p>I'm already using jQuery, so any answers are free to use it as well.</p>
