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

using "if" statement

New Here ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

Hi

 

In my adobe form I have 3 text fields:

  'Dep"

  "Arr"

  "DepartureClearance"

Im trying to write a script that depending on what is in Dep and Arr it will auto populate DepartureClearnce using var 

If tried the script below but it doesnt work

 

var Departure = {
APDAK: "A1B, 124.5, SQ",
FAOR: "FAOR",
FACT: "FACT"
}
function DClearance() {
if (this.getField("Dep").value == Departure.FAOR) {
if (this.getField("Arr").value == Departure.FACT) {
this.getField("DepartureClearance").value = Departure.APDAK;
}
}
}

 

Any Suggestions?

TOPICS
Create PDFs , JavaScript , PDF forms

Views

279

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
Community Expert ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

Where does you use the function?

Votes

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 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

I'm using it in Adobe DC, the script is in my document JavaScripts and I call up the function in keystroke script using if (event.willCommit){ DClearance() }

Votes

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
Community Expert ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

Where as keystroke script?

Votes

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 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

Yes the function is called using the keystroke script, but the funtcion itself is in the document JavaScript

Votes

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
Community Expert ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

On what field does you use the script?

Votes

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 22, 2021 Apr 22, 2021

Copy link to clipboard

Copied

The keystroke script is in the field "Arr",Ive attached some screenshots if that helpsWhatsApp Image 2021-04-22 at 15.00.24.jpegWhatsApp Image 2021-04-22 at 15.01.11.jpeg

Votes

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
Community Expert ,
Apr 22, 2021 Apr 22, 2021

Copy link to clipboard

Copied

LATEST

In the field "Arr" you will get correct value with 

  event.value 

 

  this.getField("Arr").value

will give the old value.

Votes

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