Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help with adding a number by one increment with each instance of "reset button"

New Here ,
May 13, 2020 May 13, 2020

The answer I found here: 

https://answers.acrobatusers.com/Help-adding-number-increment-instance-reset-button-q96703.aspx 

was beyond my technical knowledge. 

I'd like to know first how to create a form reset button and then have it increment the previous number on save and close.

Where/how do I add the Javascript code?

TOPICS
Acrobat SDK and JavaScript
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 13, 2020 May 13, 2020

Reset button: Add a button with the "Reset Form" command as its Mouse Up action.

Counter field: When do you want to change its value, exactly?

The basic code to do it is:

var f = this.getField("Counter");

f.value = Number(f.value)+1;

f.defaultValue = f.value;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 13, 2020 May 13, 2020

Try67,

Thanks for your response.

I'm new to Javascript in Acrobat. I composed my form in InDesign including text fields and check boxes.and added a reset button which works well. Where do I add the script in Acrobat?

 

Ideally I would like to increment on save or some other suggestion that would allow me to have a different record each time. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 13, 2020 May 13, 2020

I would use the Will Save event. You can find it under Tools - JavaScript - Set Document Actions.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 21, 2020 May 21, 2020
LATEST

Is it possible to add step by step screenshots? I am sure there are others who would benefit from this.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines