Skip to main content
Participant
September 3, 2017
Question

A strange problem in Adobe javascript Calculate event

  • September 3, 2017
  • 3 replies
  • 721 views

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 has been closed for replies.

3 replies

Participant
September 3, 2017

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?

try67
Community Expert
Community Expert
September 3, 2017

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.

Participant
September 3, 2017

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??

Inspiring
September 3, 2017

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

try67
Community Expert
Community Expert
September 3, 2017

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