I don't want the engineer to be able to digitally sign the form unless they have attached a particular check sheet file. I have a list box that displays the file names of all files the user attaches. I need JavaScript that will look for the attachment file name "Supplier Check Sheet" in the list box and if found, then allows the engineer to sign the form. If not found, i will have an error message appear. If you can tell me how to search for the file name in the list box, I can probably do the rest.
Solved! Go to Solution.
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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.
Views
Replies
Total Likes