• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Need Javascript Formulate for Adobe Acrobat Calculation Field

Community Beginner ,
Aug 07, 2020 Aug 07, 2020

Copy link to clipboard

Copied

I am working on a fillable form for a cemetery.  If you look at the attachment the two fields on the right are usually calculated with tax which I create a formula for to register in the Sales Tax box.  However, after I completed the form the cemetery owner informed me that some items in those two categories are not taxable but she was unable to override the calculated amount.

The existing formula is    (Amount3+Amount4)*.06  which is displated in Amount7    I was thinking that I could change block 7 (which is to the left of Sales Tax) to a drop down with Yes or No.  But then I need a formula that would look to block 7 and if it is checked No then it would register as $0.00 in the Amount7 (Sales Tax) field, otherwise it would report the 6% sales tax.
Thank for any help.

Views

838

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 07, 2020 Aug 07, 2020

If this is what you had in mind add this code to Amount7 field "Custom Calculation Script"

 

 

var a = this.getField("Amount3").value;
var b = this.getField("Amount4").value;
var c = this.getField("Dropdown").value;
if(c == "No"){event.value = "$0.00";
}else event.value = (a+b)*.06;

Votes

Translate

Translate
Community Expert ,
Aug 07, 2020 Aug 07, 2020

Copy link to clipboard

Copied

If this is what you had in mind add this code to Amount7 field "Custom Calculation Script"

 

 

var a = this.getField("Amount3").value;
var b = this.getField("Amount4").value;
var c = this.getField("Dropdown").value;
if(c == "No"){event.value = "$0.00";
}else event.value = (a+b)*.06;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 07, 2020 Aug 07, 2020

Copy link to clipboard

Copied

LATEST

A small note: It's better not to include the currency symbol when applying the value. Just use 0 or even "0", and let the Format setting of the field add the currency symbol. Otherwise you won't be able to set it up as a Number field and use it in other calculations.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines