This question is locked. New answers and comments are not allowed.
I'm having a problem retrieving the value of a DropDowList item. I'm subscribing to the onChange event of the control and in that event I'm doing a simple test to retrieve the value, however each time I get back the text.
My DropDowList is defined as follows:
And my event handler has code that looks like this:
When I check the console in Firebug, both lines display the Text value that was selected with the value nowhere to be found.
Is there something I'm missing here? I'm on version 2011.1.414. . .
Thanks in advance for the help!
brian
My DropDowList is defined as follows:
<% List<ListItem> list_items = new List<ListItem> { new ListItem {Text = "List", Value = "1"}, new ListItem {Text = "Map", Value = "2"}, new ListItem {Text = "Chart", Value = "3"} }; Html.Telerik().DropDownList() .Name("DropdownBox") .BindTo(new SelectList(list_items)) .SelectedIndex(0) .ClientEvents(events => events.OnChange("listChange")) .Render(); %>And my event handler has code that looks like this:
var combobox = $(this).data('tDropDownList');console.log(combobox.text());console.log(combobox.value());When I check the console in Firebug, both lines display the Text value that was selected with the value nowhere to be found.
Is there something I'm missing here? I'm on version 2011.1.414. . .
Thanks in advance for the help!
brian