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

Simple The Field-B Value is 25; the Field-A value is value found in Field-C I nned Adobe Java Scrpt

New Here ,
Sep 06, 2022 Sep 06, 2022

Using Adobe Acrobat Standard 2020; I have three fields (Field-A; Field-B, Field-C) I would like the following: If Field B is 25; then Failed -A is the value found in Filed C. Help Please.  Rookie here.

TOPICS
Create PDFs , How to , JavaScript , PDF forms
940
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Sep 06, 2022 Sep 06, 2022

Use this as custom calculation script of "EERate" field:

var drop = this.getField("EEDrop").valueAsString;
if(drop == "17")
event.value = this.getField("A17").value;
else if(drop == "16")
event.value = this.getField("A16").value;
else if(drop == "19")
event.value = this.getField("A19").value;
else
event.value = "";

View solution in original post

Translate
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
Community Expert ,
Sep 06, 2022 Sep 06, 2022

What should happen to "Field-A" if value is not 25?

Use this as custom calculation script of "Field-B":

if(event.value == 25)
this.getField("Field-A").value = this.getField("Field-C").value;

Translate
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 ,
Sep 06, 2022 Sep 06, 2022

Hello I was just using that as a value.  Here is teh Situation:

Field A: I want the result/value to show here

Field B: Is a dropdown with multiple numeric values to choose from

Field C: Has a value in it.

When a value is slected in Field B dropdown, tells Field A to pull value from specifc field (Field C)

 

Your help is truly appreciated.

 

 

Translate
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
Community Expert ,
Sep 06, 2022 Sep 06, 2022

Script will do that, just change field names to your actual field names and if you have more than one condition, add 'else if' for other conditions.

Translate
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 ,
Sep 06, 2022 Sep 06, 2022

Thanks I am such a rookie, I have never written script before. 

 

This is what I have:

 

var Field A= this.getField("B").value;

if( Value of Field B )event.value = this.getField("C").value;

 

It doesn’t work. I have no idea.  I am sorry.  Can you send me the sample script?

 

Thanks!

 

Brian Johsnon

Translate
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
Community Expert ,
Sep 06, 2022 Sep 06, 2022

So if anything is selected from dropdown, Field A = Field C?

Do you have any default value in dropdown?

Translate
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 ,
Sep 06, 2022 Sep 06, 2022

No Default yet I will try to put one in.  Here is is a picture of what I am trying to do.

 

Brian25825409j52w_0-1662485374524.png

 

Translate
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
Community Expert ,
Sep 06, 2022 Sep 06, 2022

Use this as custom calculation script of "EERate" field:

var drop = this.getField("EEDrop").valueAsString;
if(drop == "17")
event.value = this.getField("A17").value;
else if(drop == "16")
event.value = this.getField("A16").value;
else if(drop == "19")
event.value = this.getField("A19").value;
else
event.value = "";

Translate
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 ,
Sep 06, 2022 Sep 06, 2022
LATEST

It Worked!

 

You are awesome!  Please have a great day and Thank you very much!

Translate
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