This is a migrated thread and some comments may be shown as answers.

[Solved] Compared old and new selected value in Telerik dropdown

0 Answers 73 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pablo
Top achievements
Rank 1
Pablo asked on 27 Jul 2012, 11:01 AM
Hi,

I'm using a telerik dropdown to display a list of items, and when selecting one of them I execute a javascript function, so I use the OnChange event as it follows ...

@(Html.Telerik().DropDownList()
   .Name("Status" + taxReturn.ID.ToString())
   .SelectedIndex(taxReturn.StatusId)
   .BindTo((SelectList)ViewData["TaxReturnStatusEnum"])
   .ClientEvents(events => events.OnChange("onStatusChanged"))
   .HtmlAttributes(new { data_returnid = taxReturn.ID, style = "Height: 20px; width: 120px" }))

However, in the javascript I would need to compare the old selected value with the new one and I cannot do it as when the function is executed on the OnChange event, the old selected value has been lost and it's not on the markup anymore. Maybe I shouldn't use the OnChange event? Is there any solution?

Thanks in advance
Tags
ComboBox
Asked by
Pablo
Top achievements
Rank 1
Share this question
or