Perform calculation dependent upon drop-down selection

Participant ,
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

153

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

Most Valuable Participant , 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 = "";

Likes

Translate

Translate
Most Valuable Participant ,
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 = "";

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

Copy link to clipboard

Copied

LATEST

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

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