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

New Here ,
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, How to, PDF forms, Rich media and 3D

Views

460

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

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

New Here ,
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, How to, PDF forms, Rich media and 3D

Views

461

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
May 13, 2020 0
Most Valuable Participant ,
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
Reply
Loading...
May 13, 2020 0
New Here ,
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
Reply
Loading...
May 13, 2020 0
Most Valuable Participant ,
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
Reply
Loading...
May 13, 2020 0
trevor_b LATEST
New Here ,
May 21, 2020

Copy link to clipboard

Copied

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
Reply
Loading...
May 21, 2020 0