Skip to main content
Participant
February 12, 2020
Question

Script help for a newbie?

  • February 12, 2020
  • 1 reply
  • 413 views

Hello all,

 

I currently have a dropdown menu with the following options: FHA, USDA, VA, Uninsured, FNMA, Conventional Insured. What I need is a script that based on the selection from the dropdown, it will take information from another field in the form (UPB) and multiply it by a specific number (the numbers are different based on the dropdown selections). Is there a way to create a script to achieve this? 

 

I only know what I've learned from poking around in acrobat myself--any help would be greatly appreciated! 

 

 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
February 12, 2020

You can use something like this as the custom calculation script of the target field (change the name of the drop-down in line #1 and the values as needed, of course):

 

var s = this.getField("Dropdown1").valueAsString;
var v = Number(this.getField("UPB").valueAsString);
if (s=="FHA") event.value = 5 * v;
else if (s=="USDA") event.value = 10 * v;
// etc.
else event.value = "";
Participant
February 14, 2020

 

This worked perfectly, try67! Thank you so much! ~