Hi i am using a dropdown list to populate the products using :
@Html.DropDownList("Product", new SelectList(Model.Products, "ProductUrl", "ProductName"))
Which is rendered as :
<select id="Product" name="Product">
<option value="http://www.domain.co.uk/test?specs=5">produc1</option>
<option value="http://www.domain.co.uk/test?specs=6">product2</option>
<option value="http://www.domain.co.uk/test?specs=7">product3</option>
</select>
What I want to do is when the certain product is selected the system should navigate to the option value of that product, for instance if product1 is selected by the client from the dropdown list , the website should navigate to http://www.domain.co.uk/test?specs=5 which is the option value for that product1,
Any ideas of how to do this..??
Thanks
You can use either of the following methods, Pure Javascript or jQuery:
jQuery:
Working Example
Javascript:
Working Example