I have a multi-select <asp:listbox> and a button. I want to disable the button unless >= 1 item in the listbox is selected. How can I do this client-side? I can’t find some sort of OnSelect callback, only OnSelectedIndexChanged which from googling seems complicated to use for this behavior, possibly impossible.
I have a multi-select <asp:listbox> and a button. I want to disable the button
Share
Use OnChange event, and count the selected items :
EDIT : ASP:ListBox rendered to HTML as select as the code above. So all you need to do is to add the script at the onchange attribute :