• How to do an if then statement on a PDF form

# How to do an if then statement on a PDF form

New Here ,
Aug 03, 2022 Aug 03, 2022

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

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
4 Replies 4
Aug 03, 2022 Aug 03, 2022

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

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Aug 03, 2022 Aug 03, 2022

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

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 03, 2022 Aug 03, 2022

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

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Aug 08, 2022 Aug 08, 2022

Copied

LATEST

Ok thank you!

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources