I just got AcrobatX Pro 10 and am getting my feet wet with the abilities of the fillable forms. I have been able to figure out basic computation and formulas but have hit a road block in being able to have a field automatically put in a number based on the response from another field. Here is what I would like to do:
If field 1 is a drop down box for all state abbreviations then I would like field 2 to recognize which state was selected and auto fill a number based on that state ie. if NJ is selected then field 2 will auto fill: $25,000. If NY is selected then field 2 will auto fill $50,000. Some states will have the same number associated with it so NJ, PA, DE might have $25,000 associated with it and NY, MA, RI might have $50,000 associated with it.
I appreciate anything that anyone can do to point me in the right direction!
Dan
// Custom calculate script for Field 2
var prices = {" ": 0, "NJ": 25000, "NY": 50000, "WA": 15000, "PA": 25000, "DE": 25000, "WY": 10000, "CA": 45000, "MA": 50000};
event.value = prices[getField("STATE").value];
Replace "STATE" with the actual name of the combo box you're using. Add as many entries to the "prices" object as needed. Note the first item is a single space, which is a common thing to include in a comb box to indicate no selection, but you still need to account for it.