Skip to main content
Participant
Feb 12, 2020 9:35 PM UTC
Question

Script help for a newbie?

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 is closed to new replies. Start a new post to keep the conversation going.

2 replies

try67
Community Expert
Community Expert
Feb 12, 2020 10:00 PM UTC

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 = "";
Translate
Participant
Feb 14, 2020 3:36 PM UTC

 

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

Translate