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

[Solved] javascript client-side OnClientSelectedIndexChanged

2 Answers 183 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dario Zanelli
Top achievements
Rank 1
Dario Zanelli asked on 05 Jan 2010, 03:48 PM
Hi all!
I have a problem. I explain my situation: I have a C# class that generates a user control (without the .aspx file). In the page I have a RadComboBox control and I need to fire an event after the text or the selected item have been changed. The javascript is external.
In the Page_Load the code that defines the event is (the code is the same also for OnClientTextChanged) :
this._cmbFilter.OnClientSelectedIndexChanged = "ComboTextChanged";

The javascript code is at the moment really simple, but still doesn't work.

function ComboTextChanged(sender){
    alert("Sender = " + sender + " Id = " + sender.id);
  }

What I see when I execute the page is Sender = object, Id = null.
Is there any way to solve this problem? I have also tried passing arguments to the javascript, or with the $find("") function.

Thanks in advance for any help!

Dario Zanelli

2 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 05 Jan 2010, 04:08 PM
Hello Dario Zanelli,

Please use sender.get_id() to get the Id of the RadComboBox client-side object.

All the best,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Dario Zanelli
Top achievements
Rank 1
answered on 05 Jan 2010, 04:15 PM
Dear Simon,
Thanks a lot for the prompt answer.
You have actually solved my problem.

Best regards,

Dario Zanelli
Tags
ComboBox
Asked by
Dario Zanelli
Top achievements
Rank 1
Answers by
Simon
Telerik team
Dario Zanelli
Top achievements
Rank 1
Share this question
or