Adding drop down list to a dynamic stamp
Copy link to clipboard
Copied
I have a stamp that asks the user to enter data into fields. I would like one of the fields to be a drop down list and the stamp to query the user for which item to show. How would I get the dropdown list to show?
if ((event.source.forReal)&&(event.source.stampName == "#Invalid_Stamp"))
{
this.getField("Element").value = app.response("Element:");
this.getField("SampleNumber").value = app.response("SampleNumber:");
this.getField("Reason").List.value = app.response("Reason:");
this.getField("Date").value = util.printd("mm/dd/yyyy" , new Date());
}
Copy link to clipboard
Copied
There's no reason to put a drop-down field on the stamp itself, since the user can't interact with it. You can use a text field.
The drop-down field needs to be in the dialog object where you prompt the user to select a value out of a pre-defined list.
Then you take that selected value and apply it to the field in your stamp.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Did you look at the links I posted? It's all explained there.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
All of the fields on a dynamic stamp are filled automatically. The user never sees them. All they see is the flattened result on the stamp. Filling fields interactively requires a popup dialog. For a dropdown you'll need a custom dialog.
You'll find more info on this here:
https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm
https://acrobatusers.com/tutorials/dynamic_stamp_secrets/
Here's some info on custom popup dialogs:
https://www.pdfscripting.com/public/ACRODIALOGS-OVERVIEW.cfm
Use the Acrobat JavaScript Reference early and often

