submitting form with jquery not working as expected
<p>I'm trying to submit a form using jquery after modifying it's action attribute. The action attribute updates fine, but I was expecting the browser location to be the same as the action. But it's not that way. Do you see why?</p>

<p>Here's the form:</p>

<pre><code>&lt;form method="GET" class="modForm" action=""&gt;
&lt;input type="text" placeholder="Search" class="modSearchValue"&gt;
&lt;input type="radio" name="text" value="text" class="text" title="Search"&gt;
&lt;/form&gt;
</code></pre>

<p>Here's the jquery:</p>

<pre><code>$('.modForm').submit(function(event) {

        var $this = $(this),

        var query = $this.find('.modSearchValue').val(); // Use val() instead of attr('value').
        var locale = window.location;
         if($('.text').is(':checked')){query = '&amp;text='+query;}else{query = '&amp;handle='+query;}
        route = locale+query;
        console.log(route);

        if (query.length &gt;= 1) {
        // Use URI encoding
        var newAction = (route);
        console.log(newAction); // DEBUG
        // Change action attribute
        $this.attr('action', newAction);
        //event.preventDefault();
        } else {
        console.log('Invalid search terms'); // DEBUG
        // Do not submit the form
        event.preventDefault();
        }
    });
</code></pre>

<p>Here, if the current location is <code>http://localhost/search</code> and the search term is 14, the action will be changed to <code>http://localhost/search/?handle=14</code> and then submit. But for some reason, it wont.</p>
