@Html.DropDownList("CityColumnSelection", new List<SelectListItem>()
{ new SelectListItem { Text = "City Name", Value = "CityName" },
new SelectListItem { Text = "PIN", Value = "PIN" } ,
}, "Select Column", new { @class = "filterDropDownDiv" })
@Html.DropDownList("FilterOptions", new List<SelectListItem>()
{ new SelectListItem { Text = "Begins with", Value = "StartsWith" },
new SelectListItem { Text = "Contains", Value = "Contains" } ,
new SelectListItem { Text = "Doesn't contain", Value = "Not Contains" } ,
new SelectListItem { Text = "Ends with", Value = "EndsWith" },
new SelectListItem { Text = "Equals", Value = "5" },
new SelectListItem { Text = "Doesn't equal", Value = "6" }
}, "Select Filter", new { @class = "filterDropDownDiv" })
Above are my dropdowns, where If i select the pin option from 1st dropdown, I should be able to filter out the options from the other dropdown to only equals. As the pin is a numeric column Contains and other options will not make any sense. I have want to do it using jquery. How can i do it.? Can i check on the
$("#dropdown").change(function () { function and manually make the other options visible true or false.? Or is there any other method.?