My form has some items added to a ListBox by the form user.
I need a script that will loop through the ListBox list, find and delete any items that display as blank (can click in that row but no text is displayed).
Solved! Go to Solution.
Views
Replies
Total Likes
You may need to modify this a little to suit your purposes: It doesn't catch list items with a blank space.
var lbList = xfa.resolveNode("lbStuff.#items");
for (i = lbStuff.length-1; i>=0; i--){
if (lbList.nodes.item(i).value == "") lbStuff.deleteItem(i);
}
I tested with a list box "lbStuff" that contained "15", "", " ", and "16" as values. This script removed the "", but left the " ". So if it is possible for the user to add an item with spaces and no text, it will need to be modified a little.
Views
Replies
Total Likes
You may need to modify this a little to suit your purposes: It doesn't catch list items with a blank space.
var lbList = xfa.resolveNode("lbStuff.#items");
for (i = lbStuff.length-1; i>=0; i--){
if (lbList.nodes.item(i).value == "") lbStuff.deleteItem(i);
}
I tested with a list box "lbStuff" that contained "15", "", " ", and "16" as values. This script removed the "", but left the " ". So if it is possible for the user to add an item with spaces and no text, it will need to be modified a little.
Views
Replies
Total Likes
As far as I can tell, your script solved my problem.
Thank you so very much for your help!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies