I have a form which has various elements that I need to submit back to the page. However, one of the select elements shows product models and I want that element to become part of the URL that the form submits to.
<form action="" onSubmit="window.location.href=this.ProductModel.options[this.ProductModel.selectedIndex].value; return false;" enctype="multipart/form-data" method="post">
<select name="Country" id="Country">
<option value="USA">USA</option>
<option value="UK">UK</option>
<option value="India">India</option>
</select>
<select name="ProductModel" id="ProductModel">
<option value="/gaming/ps4">Playstation 4</option>
<option value="/gaming/xboxone">Xbox One</option>
<option value="/gaming/3ds">Nintendo 3DS</option>
</select>
</form>
So if a user was to select the Playstation 4 for example, I want the form to submit and go to the url http://myrootpage.com/gaming/ps4.
I can get it to go to the URL http://myrootpage.com/gaming/ps4 using the javascript code in the form onSubmit attribute but because I have to return false for it to work, none of the form field values are making it through.
How could this be solved?