Acrobat Pro DC display greatest value between multiple fields.

New Here ,
Oct 02, 2019

Copy link to clipboard

Copied

I've found many different similar options but most of what I've found are severely dated.

 

I am using Adobe Acrobat Pro DC. I have 6 numeric text fields and in the 7th field I need to create a custom script to display the highest/greatest/Max number between those 6 fields.

 

The field titles are:

SeptSteps (user input number)
OctSteps (user input number)

NovSteps (user input number)

DecSteps (user input number)

JanSteps (user input number)

FebSteps (user input number)

TotalSteps (Read Only, need to display highest number of the previous 6)

 

Could anyone please assist? Thanks in advance!

TOPICS
Acrobat SDK and JavaScript

Views

60

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

Acrobat Pro DC display greatest value between multiple fields.

New Here ,
Oct 02, 2019

Copy link to clipboard

Copied

I've found many different similar options but most of what I've found are severely dated.

 

I am using Adobe Acrobat Pro DC. I have 6 numeric text fields and in the 7th field I need to create a custom script to display the highest/greatest/Max number between those 6 fields.

 

The field titles are:

SeptSteps (user input number)
OctSteps (user input number)

NovSteps (user input number)

DecSteps (user input number)

JanSteps (user input number)

FebSteps (user input number)

TotalSteps (Read Only, need to display highest number of the previous 6)

 

Could anyone please assist? Thanks in advance!

TOPICS
Acrobat SDK and JavaScript

Views

61

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
Oct 02, 2019 0
Adobe Community Professional ,
Oct 02, 2019

Copy link to clipboard

Copied

You can use the Math.max function.

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...
Oct 02, 2019 0
Adobe Community Professional ,
Oct 02, 2019

Copy link to clipboard

Copied

For the Cuatom calculation scrlpt of the TotalSteps field:

 

var Sep = +this.getField("SeptSteps").value;
var Oct = +this.getField("OctSteps").value;
var Nov = +this.getField("NovSteps").value;
var Dec = +this.getField("DecSteps").value;
var Jan = +this.getField("JanSteps").value;
var Feb = +this.getField("FebSteps").value;

event.value = Math.max(Sep, Oct, Nov, Dec, Jan, Feb);

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...
Oct 02, 2019 0