onSelectedIndexChanged

3 posts, 0 answers
  1. Joe
    Joe avatar
    10 posts
    Member since:
    Jun 2011

    Posted 24 Jun 2011 Link to this post

    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. Gimmik
    Gimmik avatar
    170 posts
    Member since:
    May 2011

    Posted 29 Jun 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Joe
    Joe avatar
    10 posts
    Member since:
    Jun 2011

    Posted 29 Jun 2011 Link to this post

    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
Back to Top