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

onSelectedIndexChanged

2 Answers 78 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 2
Joe asked on 24 Jun 2011, 05:45 PM
Hi,

I have several ComboBoxes on a form and I want to use a single onSelectedIndexChanged javascript function for all of them.

A. Can I do this?
B. How do I determine which control was changed in the function?

2 Answers, 1 is accepted

Sort by
0
Gimmik
Top achievements
Rank 1
answered on 29 Jun 2011, 03:50 PM
Hi Joe,

This is actually fairly simple.

A) Yes - This can be easily done. Simply wire-up each RadComboBox to call the same client-side JavaScript function. This works the same as wiring up one RadComboBox, only you only have one function and you also use the same function name on the declarative code.

B) This is also simple. The footprint of the JavaScript function is:
function functionName(sender, args);

When the JavaScript function in invoked by a RadComboBox, it includes a reference to itself. In other works, the sender parameter always points back to the control that invoked the function, in this case a RadComboBox.

I hope this helps,
-Gimmik
0
Joe
Top achievements
Rank 2
answered on 29 Jun 2011, 03:54 PM
Thanks for the reply. I did get that far but I am trying to replace some dropdown controls in a third party software package and it doesn't like what I'm doing to it :) I am trying to revert and see where it's breaking. Again, thanks for the input.

Joe
Tags
ComboBox
Asked by
Joe
Top achievements
Rank 2
Answers by
Gimmik
Top achievements
Rank 1
Joe
Top achievements
Rank 2
Share this question
or