Skip to main content
Participating Frequently
January 7, 2023
Question

How to get a app.alert popup when 2 conditions are met in the fillable PDF?

  • January 7, 2023
  • 1 reply
  • 2436 views

Hello,

New here so I need some help.

 

How do I get a popup whenever the calculated field is less than 4 AND another field called  "super" has a number value greater than zero.

 

This is what I have and the "super" field doesn't seem to have any effect on the popup.

 

var s = this.getField("super").value;

if(event.value<4&&s>0);
app.alert("All 4 requirements must be met in order to qualify for the super rebate amount.")

 

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
January 7, 2023

remove the semicolon at the end of the if condition. 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Betty5C77Author
Participating Frequently
January 7, 2023

Thanks, but the behavior didn't improve after I removed the semicolon. What I want is that there should be no popup unless the "super" field has a value AND the event field is less than 4.

 

What I have now:

var s = this.getField("super").value;

if(event.value<4&&s>0) app.alert("All 4 requirements must be met in order to qualify for the super rebate amount.")

 

Currently, the alert still pops up whenever the event field is less than zero regardless of what the "super" field value is. It's not taking into account the value of the "super" field. 

 

I'm not sure if it matters, but the event field is the sum of 4 checkboxes, each with an export value of 1. And the "super" field is what the user would put in,

 

Betty5C77Author
Participating Frequently
January 7, 2023

The script is in validation. 

 

Sorry!! I misspoken.

Currently, the alert still pops up whenever the event field is less than 4 (not zero) regardless of what the "super" field value is. It's not taking into account the value of the "super" field. 

 

Thanks in advance for your help.

 


I want to make it so that the pop alert would ONLY occur when the "super" has a value AND the event value is less than 4.