Change part of a url post method with value from select box

Hi,

For a very specific project, I need to change the url of the post method for a form depending on the value of a select box.

ie…

$('#email').change(function(){
change the value of the email in the action of the form
}
<form method="post" action="index.asp?email=user@email.com&password=password">
<select id="email" name="email">
	<option value="">Please select a user</option>
	<option value="user1@email.com">user1@email.com</option>
	<option value="user2@email.com">user1@email.com</option>
</select

</form>

Your script would look something like this:
$(‘email’).change(function() {
$($(‘form’)[0]).attr(‘action’, ‘index.asp?email=’+ $(this).val());
});

I think this should work (I tend to write pure JS, so sometimes my brain goes a bit sideways for jQuery stuff…)