Skip navigation
Currently Being Moderated

How to do Script in Acrobat reader pro * Monthly Payment*

Jul 31, 2012 10:26 AM

Hallo,

 

I hope somone can help me with script.

 

I need an editable PDF file that  have two text field. text field1 have price, text field2  shoud be calculate automaticly monthly payment,

 

Example:

 

if the price in  filed1:100-300 $---------------shoud be in field2  $10/monthly.

if the price in  filed1:301-349 $------------shoud be in field2  $11/monthly.

if the price in  filed1: 350-399 $------------shoud be in field2  $12/monthly.

if the price in  filed1: 400-449  $------------shoud be in field2  $13/monthly.

thanks

 
Replies
  • Currently Being Moderated
    Jul 31, 2012 12:30 PM   in reply to doaur

    What kind of software do you use? There is no product with the name 'acrobat reader pro'.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 31, 2012 3:05 PM   in reply to doaur

    For the "field2" custom calculation script, one could use:

     

    // get the value of "field1"

    var nPrice = this.getField("field1").vallue;

    // set monthly payment base on the range of value of field1

    switch(true) {

    case (nPrice >= 100 && nPrice < 301) :

    // price is greater than or equal to 100 and less than 301

    event.value = 10;

    break;

     

    case (nPrice >= 301 && nPrice < 350) :

    // price is greater than or equal to 301 and less than 350

    event.value = 11;

    break;

     

    case (nPrice >= 350 && nPrice < 400) :

    // price is greater than or equal to 350 and less than 400

    event.value = 12;

    break;

     

    case (nPrice >= 400 && nPrice < 450) :

    // price is greater than or equal to 100 and less than 301

    event.value = 13;

    break;

     

    default:

    // all other prices

    event.value = "";

    break;

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 31, 2012 7:17 PM   in reply to GKaiseril

    Attn: Bernd Alheit

     

    Hi Gkaiseril

     

    Thanks, I was looking for a script like that.

    The script works good,

    Except "vallue" is misspelled on line 2.

    Change "vallue" to value and it is good to go.

     

    Ron A

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points