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?
Copy link to clipboard
Copied
Where does you use the function?
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() }
Copy link to clipboard
Copied
Where as keystroke script?
Copy link to clipboard
Copied
Yes the function is called using the keystroke script, but the funtcion itself is in the document JavaScript
Copy link to clipboard
Copied
On what field does you use the script?
Copy link to clipboard
Copied
The keystroke script is in the field "Arr",Ive attached some screenshots if that helps
Copy link to clipboard
Copied
In the field "Arr" you will get correct value with
event.value
this.getField("Arr").value
will give the old value.