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

If/else help needed please *solved*

Participant ,
Oct 18, 2019 Oct 18, 2019

Copy link to clipboard

Copied

I've tried to do this myself, but I'm missing something as it doesn't work! Could someone correct me please

 

Basically, if the VatValue.3 field says 'Exempt', the aVATRate.3 field should say 0, but if the field shows a percentage value (eg 20%), them it should show the value divided by 100.

 

if (this.getField("VatValue.3").value == "Exempt") {
event.value = 0;
}
else {
event.value = .value/ 100.0;
}

 

 

TOPICS
Acrobat SDK and JavaScript

Views

266

Likes

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 , Oct 18, 2019 Oct 18, 2019

Try this:

if (this.getField("VatValue.3").value == "Exempt") {
event.value = 0;
}
else {
event.value = this.getField("VatValue.3").value/ 100.0;
}

Likes

Translate

Translate
Community Expert ,
Oct 18, 2019 Oct 18, 2019

Copy link to clipboard

Copied

Try this:

if (this.getField("VatValue.3").value == "Exempt") {
event.value = 0;
}
else {
event.value = this.getField("VatValue.3").value/ 100.0;
}

Likes

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
Participant ,
Oct 18, 2019 Oct 18, 2019

Copy link to clipboard

Copied

LATEST

Perfect! Thank you Bernd - much appreciated 🙂

Likes

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