I am a javascript novice and need help in programming a simple selection from a Combo Box. The Combo Box will have a list of products - Product1, Product2, ...
I want a different PDF to open depending on the selection. E.g. ProductOne.pdf; ProductTwo.pdf ...
Any help with the javascript for this (ora better way to do it) will be appreciated.
Tia.
Jeff
// select document file name
var sFileName; // variable for file name
switch (this.getField(event.target.name).value) {
case "Select Document":
sFileName = ""; // empty file name
break;
case "Product 1":
sFileName = "ProductOne.PDF";
break;
case "Product 2":
sFileName = "ProductTwo.PDF";
break;
case "Product 3":
sFileName = "ProductThree.PDF";
break;
default:
sFileName = ""; //empty file name
app.alert("Unknown Selection: " + event.value);
break;
} // end selection
// open non-empty file name
if (sFileName != "") {
// open using relative path name
var otherDoc = app.openDoc(sFileName, this); // open selected doc
this.closeDoc(); // close current document
}
The above is not possible in Live Cycle Designer because Live Cycle Designer does not include the "app.openDod()" method.
George Kaiser