Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1740
JavaScript SelectedIndexChanged does not work
posted

I have a WebDropDown control with multi-select checkbox option enabled.

After writing the SelectedIndexChanged javascript function the checkboxes are not checked at all -

        function selectedIndexChanged(sender, eventArgs) {

            var newItems = eventArgs.getNewSelection();

            var newItemsString = "";

 

            for (i=0;i<newItems.length;i++)

                newItemsString += newItems[i].get_index() + ", ";

            alert(newItemsString);

        }

This is a piece of code that I copied from the samples but it does not work.

Could you somebody please suggest what could be wrong?

Parents
No Data
Reply
  • 24671
    posted

    Hi ,

    The code only prints the list of selected items, but you will still need to perform the selection either manually (by checking some of the items), or through code, by calling .select() on the items you want to be selected. If you already do that, and the issue is that the above code doesn't show any items as selected, then this is very strange - I will take a look if that's the case.

    Thanks in advance for the feedback,

    Angel 

Children