Hello, I just joined these forums after 2 days of research trying to figure this out, to no avail. I'm pretty new to Acrobat and Javascript, so the more explanation the better.
What i'm trying to do:
-I want to have a Combo Box (made in Acrobat, not LiveCycle) with a number of options, that when you select one it goes to the corresponding page in the SAME .pdf file. So, let's say the combo box has the following entries:
DCA
MHT
MEM
JFK
If the user selects one, it should jump to the corresponding page further into the .pdf
What I have so far:
-in the Properties tab of the Combo Box, under Format, I chose 'custom' and wrote the following in the Custom Keystroke Script: (Mostly for feedback)
if (event.willCommit) {
console.println("Keystroke: willCommit");
console.println("event.value = " + event.value);
console.println("event.change = " + event.change);
console.println("event.changeEx = " + event.changeEx);
} else {
console.println("Keystroke: not Committed")
console.println("event.value = " + event.value);
console.println("event.change = " + event.change);
console.println("event.changeEx = " + event.changeEx);
AirportLink(event.changeEx);
}
I also gave each item in the Combo Box the export value of A1 through A4.
Then, in the Document Javascript (Advanced -> Document Processing -> Document Javascripts) I made the following function, which was called by the Combo Box.
function AirportLink(destination)
{
this.gotoNamedDest('destination');
console.println(destination);
}
I've tried with double quotes, and just simply with the name of 1 particular destination (A3) to test, but nothing works correctly. The correct destination text is printing out in the debugger, so I know that the A1, A2, A3, etc. is being sent to the Document-level function, but It refuses to just go to that page, despite my double-checking that the Named Destinations are set up.
Does anyone know what is going wrong/ a better way to accomplish this?
Thank you very much.
You could also use the "On Blur Action":
if (this.getField(event.target.name).value != ' ') AirportLink(event.value)
George Kaiser