No radio button selected in group - no calculation performed.

New Here ,
Apr 08, 2022 Apr 08, 2022

Copy link to clipboard

Copied

There is an answer to this initial subject -  my question relates to the sequence that occurs if any one of the group of radio buttons IS selected.

 

My example in English is:

If no radio button in the group is selected no calculation is performed (the fields that reference this could show a zero or "NA"  - either would be fine)

BUT if any radio button in the group IS selected the value of that button is used as the denominator in a division calculation involving content from another field.

 

My startlingly bad attempt at interpreting this in javascript for a custom calculation follows:

var calculatedPDiff=this.getField("MFI80").value;
if(MFI80=="Off")event.value="NA";
else event.value=this.getField("TGI").value / this.getField("MFI80").value;

 

How many things am I doing wrong?? 🙂

 

 

 

 

 

TOPICS
How to , JavaScript , PDF forms

Views

52

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

Adobe Community Professional , Apr 08, 2022 Apr 08, 2022

Change:

if(MFI80=="Off")event.value="NA";

To:

if(calculatedPDiff=="Off")event.value="NA";

Likes

Translate

Translate
Adobe Community Professional ,
Apr 08, 2022 Apr 08, 2022

Copy link to clipboard

Copied

Change:

if(MFI80=="Off")event.value="NA";

To:

if(calculatedPDiff=="Off")event.value="NA";

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
New Here ,
Apr 08, 2022 Apr 08, 2022

Copy link to clipboard

Copied

LATEST

Thank you! Thank you! Thank you! Working!

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