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

I need help with a code that will auto populate

New Here ,
Mar 20, 2019 Mar 20, 2019

from another field if another field is zero. This would go after the code: event.value=Number(this.getField("EE Net Prem").valueAsString)/ Number(this.getField("multiplier").valueAsString);

TOPICS
Acrobat SDK and JavaScript , Windows
555
Translate
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 , Mar 20, 2019 Mar 20, 2019

Not sure what you're asking, but if you use this code you have to make sure that the value of "multiplier" is not zero first.

Translate
Community Expert ,
Mar 20, 2019 Mar 20, 2019

Not sure what you're asking, but if you use this code you have to make sure that the value of "multiplier" is not zero first.

Translate
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
New Here ,
Mar 20, 2019 Mar 20, 2019

the multiplier is the commission base- so usually I use the net premium/multiplier (typically .85) to populate into the gross premium field. Not all groups have commission. I keep getting an error for "the value entered does not match the format of the field (EE Gross Prem)" when the multiplier is zero.

Is there another way I should write it so it will accept a number or zero?

Translate
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 ,
Mar 20, 2019 Mar 20, 2019
LATEST

Use this code:

var v1 = Number(this.getField("EE Net Prem").valueAsString);

var v2 = Number(this.getField("multiplier").valueAsString);

if (v2==0) event.value = "";

else event.value = v1/v2;

Translate
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