Skip to main content
Participant
April 26, 2018
Answered

Java Script for Shipping Rates using Acrobat 9 Standard

  • April 26, 2018
  • 1 reply
  • 416 views

I am trying to create a java script to auto populate a shipping rate when using Forms. I am very new to js, and just trying to improve some forms for work and make them fill-able on our website.

If its possible, and someone out in Adobeland could help write I would greatly appreciate it. What I would like is for the "Merch total" field to auto-fill my "Shipping and handling" field. Our shipping rates are as follow:

$0.00 to $39.99$10
$40.00 to $74.99

$12

$75.00 to $99.99$15
$100.00 to $199.99$17
$200 and up$20

Thanks in advance!

-B

This topic has been closed for replies.
Correct answer try67

You can use this code as the custom calculation script of the S&H field:

var total = Number(this.getField("Merch total").valueAsString);

if (total<40) event.value = 10;

else if (total<75) event.value = 12;

else if (total<100) event.value = 15;

else if (total<200) event.value = 17;

else event.value = 20;

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
April 26, 2018

You can use this code as the custom calculation script of the S&H field:

var total = Number(this.getField("Merch total").valueAsString);

if (total<40) event.value = 10;

else if (total<75) event.value = 12;

else if (total<100) event.value = 15;

else if (total<200) event.value = 17;

else event.value = 20;