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

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

New Here ,
May 13, 2020 May 13, 2020

Copy link to clipboard

Copied

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

Views

490

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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;

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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. 

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Likes

Translate

Translate

Report

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