I am trying to grab whatever is selected when user selects from the option and pass it to the current URL as querystring. What am i doing wrong? It always grabs the first option
var selectedOption = $("#ctl00_PlaceHolderMain_ctl00_DropDownList1 option:selected").val();
$("#ctl00_PlaceHolderMain_ctl00_DropDownList1").change(function(e) {
window.location.href = 'http://somesite/events/Pages/default1.aspx?cat=' + selectedOption
});
And this is the HTML I am working on.
<select name="ctl00$PlaceHolderMain$ctl00$DropDownList1" id="ctl00_PlaceHolderMain_ctl00_DropDownList1">
<option value="Select Category">Select Category</option>
<option value="All Categories">All Categories</option>
<option value="Cancer">Cancer</option>
<option value="Health Lecture">Health Lecture</option>
<option value="Heart Health">Heart Health</option>
</select>