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

Perform calculation dependent upon drop-down selection

Engaged ,
Mar 31, 2021 Mar 31, 2021

Copy link to clipboard

Copied

Hi all,

 

I have a problem I am hopeful someone may know the solution. I have a field ("REGISTRATION1") that is a drop-down user selection, and that when one of two options is selected (either "A", or "B"), a calculation is made in another field (this field is "ZFWCG"). The calculation made in this field is either;

 

For selection "A"; the value in "ZFWCG", then use this figure and -22.0687/0.041935

For selection "B"; the value in "ZFWCG", then use this figure and -22.0687/0.061358

 

Is this possible?.

 

Thanks.

 

 

TOPICS
PDF forms

Views

460

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 , Mar 31, 2021 Mar 31, 2021

Sure. Use this code as the custom calculation script of "ZFWCG":

 

var reg = this.getField("REGISTRATION1").valueAsString;
if (reg=="A") event.value = -22.0687/0.041935;
else if (reg=="B") event.value = -22.0687/0.061358;
else event.value = "";

Votes

Translate

Translate
Community Expert ,
Mar 31, 2021 Mar 31, 2021

Copy link to clipboard

Copied

Sure. Use this code as the custom calculation script of "ZFWCG":

 

var reg = this.getField("REGISTRATION1").valueAsString;
if (reg=="A") event.value = -22.0687/0.041935;
else if (reg=="B") event.value = -22.0687/0.061358;
else event.value = "";

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
Engaged ,
Mar 31, 2021 Mar 31, 2021

Copy link to clipboard

Copied

LATEST

Thnaks Try! as always, superb....;-)

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