Copy link to clipboard
Copied
I've created a dynamic stamp that has two fields for the user to enter data.
The stamp and javascript code seem to be working correctly except that I
get prompted twice for the data entry, once when selecting the stamp and
again when placing the stamp. I found a work-around; if I enter the data on
the first prompt and then 'cancel' on the second prompt the stamp gets placed
and the data shows correctly. This is the code I'm using for one of the fields:
var cResponse = app.response({
cQuestion: "Enter the Dates to appear in the stamp.",
cTitle: "Dates",
cLabel: "Dates"
event.value = cResponse;
I'm using the code from some examples I found. The other thing that would
be nice is to combine the two field prompts into one prompt for the data entry.
Regards,
Mike
You're missing a gating if for only running the code when it's being placed. If you don't have this code you'll get the prompts every time any stamp is selected.
You'll find everything you need to know about stamps here:
Here's an early article on creating advance dynamic stamps. It also includes the gating code you need, which relies on the stamp name, which is explained in the article:
https://acrobatusers.com/tutorials/dynamic_stamp_secrets
For combining the response dialogs you need to use a dialog. Here is a dialog creation tool for Acrobat JavaScript:
Copy link to clipboard
Copied
I've created a dynamic stamp that has two fields for the user to enter data.
The stamp and javascript code seem to be working correctly except that I
get prompted twice for the data entry, once when selecting the stamp and
again when placing the stamp. I found a work-around; if I enter the data on
the first prompt and then 'cancel' on the second prompt the stamp gets placed
and the data shows correctly. This is the code I'm using for one of the fields:
var cResponse = app.response({
cQuestion: "Enter the Dates to appear in the stamp.",
cTitle: "Dates",
cLabel: "Dates"
event.value = cResponse;
I'm using the code from some examples I found. The other thing that would
be nice is to combine the two field prompts into one prompt for the data entry.
Regards,
Mike
You're missing a gating if for only running the code when it's being placed. If you don't have this code you'll get the prompts every time any stamp is selected.
You'll find everything you need to know about stamps here:
Here's an early article on creating advance dynamic stamps. It also includes the gating code you need, which relies on the stamp name, which is explained in the article:
https://acrobatusers.com/tutorials/dynamic_stamp_secrets
For combining the response dialogs you need to use a dialog. Here is a dialog creation tool for Acrobat JavaScript:
Copy link to clipboard
Copied
You're missing a gating if for only running the code when it's being placed. If you don't have this code you'll get the prompts every time any stamp is selected.
You'll find everything you need to know about stamps here:
Here's an early article on creating advance dynamic stamps. It also includes the gating code you need, which relies on the stamp name, which is explained in the article:
https://acrobatusers.com/tutorials/dynamic_stamp_secrets
For combining the response dialogs you need to use a dialog. Here is a dialog creation tool for Acrobat JavaScript:
Copy link to clipboard
Copied
Thank you Thom.
Copy link to clipboard
Copied
Hi Mike,
In order to have multiple input fields (or check boxes, pulldowns, radio buttons, etc) entered at once in a custom dynamic stamp you need to use a custom dialog. Coding a custom dialog is an advanced task but there is an online dialog designer that makes the job much easier than hand coding- ACRODIALOGS OVERVIEW
There are examples of custom dialogs used with stamps in the video PDF Stamps Gone Wild so you can see how they work. That video can be found at-
Hope this helps,
Dimitri
Copy link to clipboard
Copied
Thank you Dimitri.