What is the Javascript code to test if an item has been selected in a multi-select webdropdown? The following does not work:
if (document.getElementById("<%=WebDropDown1.ClientID%>").selectedIndex == 0) {
alert("Nothing selected. ");
return false;
Thank yuo.
Hello longpond,
Thank you for contacting Infragistics!
We received your support request concerning determining if a multi select dropdown has a value selected, and this case has been assigned to me. Infragistics is dedicated to helping you solve this issue. Our team and I have done an initial review of your case and you can get the SelectedItems property off of the WebDropDown:
http://help.infragistics.com/NetAdvantage/ASPNET/2012.1/CLR4.0/?page=Infragistics4.Web.v12.1~Infragistics.Web.UI.ListControls.WebDropDown~SelectedItems.html
Once you have this you can check the length of the list. For example:
var dropdown = $find("<%=WebDropDown1.ClientID %>"); if (dropdown.get_selectedItems().length >= 1) { //TODO: Code to be run }
Please let me know if you have any questions concerning this matter.
Sincerely,Mike P.Developer Support EngineerInfragistics, Inc.www.infragistics.com
I am following up to see if the information provided has resolved this matter.
Please let me know if I may be of further assistance with this matter.
Yes, it did resolve my problem. Thank you so much.