Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Need suggestion regarding drop down...

Avatar

Level 3

hi ,

i have a dropdown list having some values.I wana compare the length of the values of dropdown list to null.

i tried this

for (var i=0 ; i<=DropDownList1.length;i++);

{

var s = DropDownList1.getDispalyItem(i);

if(s.length ==null)xfa.host.messageBox("the length of the selected value is null");

else xfa.host.messageBox(" Not NULL\n in this case i have written a piece of code to execute");

}

thing is i am using Live Cycle Designer ES but that length function is not giving the length of the drop down list...

Please suggetst any idea what to do ?????

Thanks in advance.....

3 Replies

Avatar

Level 8

The length function works fine you have a typo

incorrect var s = DropDownList1.getDispalyItem(i);

correct var s = DropDownList1.getDisplayItem(i);

Avatar

Level 3

should i know what will happen if dropdown list does not have any values what could be the value of DropDownList1.length;