I have a form with multiple list boxes, each containing the same values. However, a value can only be chosen once. Here's the code I'm using to check the exit event of the first listbox:
var juris = new Array(3);
for (x = 0; x < 2; x++){
juris[x] = xfa.resolveNode("jlist["+x+"]").rawValue;
}
for (y in juris){
if (y != 0){
if (this.rawValue == juris[y]){
xfa.host.messageBox(this.formattedValue + " already listed","Information",3,0);
}
}
}
This works well but I have to change the code for each listbox so it doesn't check itself. I do this using the if (y != 0) for list[0] and would change this to if (y != 1) for list[1], etc.
Can anyone tell me how to capture the current lists' index value ([0],[1].etc) within the array so I can assign that value to variable z and use if (y != z) for each list?
Thanks
I tested this code in the change event for the drop-down. It also blocks the selection by restoring the previous value
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script