How to convert an Excel Formula to a Custom Calculation Script in a Adobe Acrobat 9 Form?


hello,

 

i not familiar whatsoever javascript , need in converting following excel formula can enter custom calculation script in adobe pdf form. here formula:

 

=if(e15<25.01,9.95,if(e15<50.01,11.95,if(e15<75.01,13.95,if(e15<100.01,16.95,if(e15<150.01 ,19.95,if(e15<200.01,24.95,if(e15>200.00,e15*0.125)))))))

 

where "e15" text field named "subtotal" on adobe pdf form.

 

thank can provide!

fortunately javascript has 'switch' statement nested if statements can avoided.

 

var e15 = this.getfield("subtotal").value;

switch(true) {

case (e15 < 25.01) :

event.value = 9.95;

break;

case (e15 < 50.01) :

event.value = 11.95;

break;

case (e15 < 75.01) :

event.value = 13.95;13

break;

case (e15 < 100.01) :

event.value = 16.95;

break;

case (e15 < 150.01) :

event.value = 19.95;

break;

case (e15 < 200.01) :

event.value = 24.95;

break;

case (e15 > 200) :

event.value = e15 * 0.125;

break;

default:

event.value = "";

break;

} // end switch;



More discussions in JavaScript


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account