How to do an if then statement on a PDF form

New Here ,
Aug 03, 2022 Aug 03, 2022

Copy link to clipboard

Copied

I am trying to do an if then statement on a PDF form.

 

The field is a calculated field A=C.  If C>6 then C=5, else C=A

 

How do I write this in Adobe Pro on a PDF form?  

TOPICS
Edit and convert PDFs , PDF forms

Views

25

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
Adobe Community Professional ,
Aug 03, 2022 Aug 03, 2022

Copy link to clipboard

Copied

Your description doesn't make much sense. Do you want to calculate the value of field A, or of field C?

And what does this mean? If C>6 then C=5

Do you mean: If A>6 then C=5 ?

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 ,
Aug 03, 2022 Aug 03, 2022

Copy link to clipboard

Copied

Hi,

Sorry about the confusion in the explanation!

I wanted to calculate the value of field C, and I wanted the value of field C to equal the value of field A and if the value of field A is greater than 6 then I wanted field C to equal 6 (rather than 5) so:

 

A=C.  If A>5 then C=5, else C=A

 

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
Adobe Community Professional ,
Aug 03, 2022 Aug 03, 2022

Copy link to clipboard

Copied

OK, that makes more sense... You can use this code as the custom Calculation script of  C to achieve it:

 

var A = Number(this.getField("A").valueAsString);
if (A>5) event.value = 5;
else event.value = A;

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 ,
Aug 08, 2022 Aug 08, 2022

Copy link to clipboard

Copied

LATEST

Ok thank you!

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