Approved
Last Updated: 05 Oct 2018 16:29 by Michael Schweighardt
Approved
Last Updated: 08 Aug 2016 13:35 by ADMIN
Approved
Last Updated: 22 Apr 2019 13:10 by ADMIN
I have a few instances where I need OnClientSelectedIndexChanging inorder to stop the listbox selectedIndexChanged event from posting back in certain cases. In those cases I stop it from posting back by setting the e.set_cancel(true);

function CheckForListBoxReorder_OnClientEvent(sender, e) {
    if (ListboxReordered()) {
        alert('Please save changes to the bus order.');
        e.set_cancel(true);
    }
}

This works very nicely, but I'm getting many errors because although it looks like it's still selected to the proper row in the listbox the selectedIndex is now -1.