## Hi, I'm a designer and not a developer and I need major help with some custom calculation script.

New Here ,
Feb 01, 2018

Copy link to clipboard

Copied

I basically need a formula involving two fields, let's name them Field1 and Field2.

So if Field1 is less than or equal to 2000 then Field2=150.

However, if Field1>2000 then Field2=Field1 multiplied by .075.

Any ideas what the script would look like??

Thank you!!

TOPICS
Acrobat SDK and JavaScript, Windows

Views

159

Likes

Report

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

## Hi, I'm a designer and not a developer and I need major help with some custom calculation script.

New Here ,
Feb 01, 2018

Copy link to clipboard

Copied

I basically need a formula involving two fields, let's name them Field1 and Field2.

So if Field1 is less than or equal to 2000 then Field2=150.

However, if Field1>2000 then Field2=Field1 multiplied by .075.

Any ideas what the script would look like??

Thank you!!

TOPICS
Acrobat SDK and JavaScript, Windows

Views

160

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 01, 2018 0
2 Replies 2
Most Valuable Participant ,
Feb 01, 2018

Copy link to clipboard

Copied

As the custom calculation script of Field2 enter this code:

`var v1 = Number(this.getField("Field1").valueAsString);if (v1<=200) event.value = 150;else event.value = v1*0.075;`

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 01, 2018 1
LATEST
New Here ,
Feb 01, 2018

Copy link to clipboard

Copied

thank you soo much this worked!!!!

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 01, 2018 0