Append select data to URL using jQuery
<p>I am having problems trying to add a parameter to a URL using jQuery based off of the value of a Select element. Here is my code so far:</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function () {
    $("#sel-1").change(function() {
        $(this).closest("form").submit();
});
var input = $("&lt;input&gt;").attr("type", "hidden").attr("name", "state").val($("#sel-1").val());
$('.start-form').append($(input));
});
&lt;/script&gt;

&lt;form action="process.php" class="start-form"&gt;
    &lt;fieldset&gt;
        &lt;div class="row"&gt;
            &lt;label for="sel-1"&gt;Select &lt;strong&gt;State&lt;/strong&gt;&lt;/label&gt;
            &lt;select id="sel-1"&gt;
                &lt;option value="Select"&gt;Select&lt;/option&gt;
                &lt;option value="AK"&gt;AK&lt;/option&gt;
                &lt;option value="CA"&gt;CA&lt;/option&gt;
                &lt;option value="TX"&gt;TX&lt;/option&gt;
            &lt;/select&gt;
        &lt;/div&gt;

        &lt;input type="submit" class="hidden"/&gt;
    &lt;/fieldset&gt;
&lt;/form&gt;
</code></pre>

<p>For some reason no matter which option I select, the URL will become process.php?state=Select. What I need it to do is become process.php?state=TX or whatever option the user selects.</p>

<p>Any help is greatly appreciated!</p>
