Help with PDF Form Calculation


ok don't know if possible wanting clients enter income in "income" felid , "contribution" felid pre-populate how can have contributed...

 

if value less $31,920 equal $1000 – works

if value more $61,920 equal $0 – works

 

if value between $31,920 , $61,920 apply following formula:

1000-(0.0333*(income-31920))  - stumped!

 

i have used following code works lesser / greater queries... when ask take value in box , use make calculation have no idea begin (or if possible) (as can tell) have made sort of code doesn’t work...

 

if (this.getfield("income").value<31920) {
  event.value = 1000
  } else {
    if (this.getfield("income").value>61920) {
    event.value = 0
  } else {
      event.value = 1000-(0.03333*((this.getfeild("income"))-31920))
  }
}

 

any takers?

you close. try following calculated field's custom calculate script:

 

(function () {

 

    // field value
    var v = getfield("income").value;

 

    if (v < 31920) {
        event.value = 1000;
        return;
    }

 

    if (v > 61920) {
        event.value = 0;
        return;
    }

 

    // v >= 31920 , =< 61920
    event.value = 1000 - (0.03333 * (v - 31920));

 

})();



More discussions in Acrobat Windows (read-only)


adobe

Comments

Popular posts from this blog

How to decompile jsxbin to jsx

Gavik Photoslide GK2: Not able to upload photos - Joomla! Forum - community, help and support

Phoca Guestbook logger registret bruger af - Joomla! Forum - community, help and support