Copy link to clipboard
Copied
Hello,
I'm trying to do something that's way over my head and would appreciate any and all help. I want acrobat to look at a field and if that number is 1 or 2 or 3 and then another field and if that number is 800 or 900 or 1000 spit a fixed number into a third field.
Copy link to clipboard
Copied
Place this script as a "calculation" script into the 3rd field:
if (this.getField("FirstField").value == 1 && this.getField("SecondField").value == 800) {
event.target.value = 123456;} // where 123456 is the "fixed number"
else if (this.getField("FirstField").value == 2 && this.getField("SecondField").value == 900) {
event.target.value = 987654321;} // where 987654321 is the "fixed number"
else if (this.getField("FirstField").value == 3 && this.getField("SecondField").value == 1000) {
event.target.value = 657483920;} // where 657483920 is the "fixed number"
// etc.
else {
event.target.value = "";} // nothing
Copy link to clipboard
Copied
Hi Meriedel,
Here is a tutorial with examples on writing if statements-
https://acrobatusers.com/tutorials/conditional-execution
Hope this helps,
Dimitri
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Place this script as a "calculation" script into the 3rd field:
if (this.getField("FirstField").value == 1 && this.getField("SecondField").value == 800) {
event.target.value = 123456;} // where 123456 is the "fixed number"
else if (this.getField("FirstField").value == 2 && this.getField("SecondField").value == 900) {
event.target.value = 987654321;} // where 987654321 is the "fixed number"
else if (this.getField("FirstField").value == 3 && this.getField("SecondField").value == 1000) {
event.target.value = 657483920;} // where 657483920 is the "fixed number"
// etc.
else {
event.target.value = "";} // nothing
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more