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

I NEED A POP-UP SCREEN TO SHOW RESULTS OF LOAN PAYMENT CALCULATION! If thats possible.

Community Beginner ,
Nov 30, 2020 Nov 30, 2020

Copy link to clipboard

Copied

Good day,

I created a loan monthly payment calculation PDF with the following fields;

- Current year: "_cYear" (a script adds in this value automatically.

- Vehicle year: "_vYear" (this value is entered by the user).

- Vehicle age: "_vAge" (this is calculated my simple script subtracting Current year from Vehicle year).

-Vehicle price: "_vPrice (this value is entered by the user).

- Term: "_term" (this value is the number of monthly payments, its value is selected based on the age of the vehicle using "if/else" function).

- Interest rate: "_iRate" (this value is fixed).

- Downpayment: "_dPayment" (this value is 15% of the Vehicle price).

- Loan Amount: "_lAmount" (this value is the Vehicle price minus the downpayment).

-Monthly payment: "_mPayment" (this value is the result of the formula).

I get the desired results, however, I will like to include a button that will open a pop-up window that shows the following statement;

if the vehicle is 7 years or less in age;

"('_mPayment'/month, '_term' months, No Downpayment - FCIB)"

Or, if the vehicle is 8 years to 10 years in age;

"('_mPayment'/month, '_term' months, '_dPayment' Downpayment - FCIB)"

Or, if the vehicle is 11 years and older in age;

"(This vehicle does NOT qualify for financing)"

Is this possible?

 

K. Gibbs.

 

TOPICS
Acrobat SDK and JavaScript

Views

105

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

correct answers 1 Correct answer

Community Expert , Dec 01, 2020 Dec 01, 2020

Code for PopUp menu:

var age = this.getField("_vAge").value;
var pay = this.getField("_mPayment").value;
var dpay = this.getField("_dPayment").value;
var term = this.getField("_term").value;
if(age <= 7){
app.alert(pay+"/month, "+term+"months, "+"No Downpayment - FCIB",3);}
else if(age >=8 && age <=10){
app.alert(pay+"/month, "+term+"months, "+dpay+" Downpayment - FCIB",3);}
else if(age >= 11){
app.alert("(This vehicle does NOT qualify for financing)",3);}

Likes

Translate

Translate
Community Expert ,
Nov 30, 2020 Nov 30, 2020

Copy link to clipboard

Copied

For a simple popup, you can use the app.alert() method: https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/index.html#t=Acro12_MasterBook%2FJ...

 

If you want something more complex, take a look at the execDialog method: https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/index.html#t=Acro12_MasterBook%2FJ...

 

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 ,
Dec 01, 2020 Dec 01, 2020

Copy link to clipboard

Copied

Code for PopUp menu:

var age = this.getField("_vAge").value;
var pay = this.getField("_mPayment").value;
var dpay = this.getField("_dPayment").value;
var term = this.getField("_term").value;
if(age <= 7){
app.alert(pay+"/month, "+term+"months, "+"No Downpayment - FCIB",3);}
else if(age >=8 && age <=10){
app.alert(pay+"/month, "+term+"months, "+dpay+" Downpayment - FCIB",3);}
else if(age >= 11){
app.alert("(This vehicle does NOT qualify for financing)",3);}

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 Beginner ,
Dec 01, 2020 Dec 01, 2020

Copy link to clipboard

Copied

LATEST

Perfect!
Worked like a charm.

Much thanks Nesa!

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