How do you get a drop down list to control the value of a Javascript variable?
I'm trying to give the option of filtering a table by year, and I want this dropdownlist to change the value of a Javascript variable called yearVariable.
My code:
<%=Html.DropDownList("yearVariable", Model.myArray, new { onchange =javascript:ReloadTable()" })%>
(as you can see, the dropdownlist is created using HTML Helper, getting its values from an array; also I don't want to have to click a submit button.) Thanks!