Skip to main content
Participant
Sep 3, 2017 11:33 AM UTC
Question

A strange problem in Adobe javascript Calculate event

I am working with Adobe Acrobat for about 6 years (since the time of acrobatusers.com). I have created thousands of forms with javascript.

Today I faced a strange problem that broke me. I have written this code in a textbox calculate event

app.alert("Hello World");

According to my experience it should show a message "Hello Word" every time the form is opened. But it is not showing any message.

I am on Windows 10 (64 bit) with Acrobat 11 and Reader DC.

I have tried it on my old laptop Windowns 10 (32bit) but the problem is same.

Please, please help me.

This topic is closed to new replies. Start a new post to keep the conversation going.

12 replies

Participant
Sep 3, 2017 2:43 PM UTC

Thank you very much.

I am still unable to digest this reply. Actually I am going to create a dynamic stamp and as you know in stamp we have only access to calculate event of stamp textbox. If calculate event of stamp textbox will not trigger ( according to your answer) how will we go further? Second I have created a date field in stamp (javascript in date field calculate event) date is no also changing when I change computer date.

Please help me. Am I missing something?

Translate
try67
Community Expert
Community Expert
Sep 3, 2017 2:52 PM UTC

Fields in stamps are even less dynamic than regular fields. They are flattened the moment the stamp is applied and can't be edited (using a script) afterwards.

Translate
Participant
Sep 3, 2017 3:55 PM UTC

Ok. Can I add a dynamic field in stamp. So that a textbox in stamp has value today's date before the stamp is applied??

Translate
Inspiring
Sep 3, 2017 2:40 PM UTC

If you want a script to run on the opening of a given page then use the "Page Open" event. If you want the script to open when the PDF is opened then use the document level event.

Entering document scripts

https://acrobatusers.com/tutorials/js_document_scripts

Translate
try67
Community Expert
Community Expert
Sep 3, 2017 12:05 PM UTC

Just opening a file does not trigger the calculation events of the fields in it.

Translate