Avatar

Correct answer by
Level 10

Hi there,

 

to search for a specific value in a list box, simply have a loop iterate through each items and compare the displayed value to "Supplier Check Sheet"

like the following:

var boFoundValue = false;
for (var i = 0; i < ListBox1.length; i++){
     var strOneItem = ListBox1.getDisplayItem(i);
     if (strOneItem.indexOf("Supplier Check Sheet") > -1){
          //If the string value is found in any displayed value from the listbox
          boFoundValue = true;
     }
}

//Now depending on the boolean value, you can disable digital signature or let it pass.

 

To accurately find the string "Supplier Check Sheet", you might want to compare the value using toLowerCase() in case the values are not matching the string's case.

The "if" statement would look like this

if (strOneItem.toLowerCase().indexOf("supplier check sheet"))

I hope this will help.

View solution in original post