Copy link to clipboard
Copied
I created the following Javascript in Adobe Pro to have a pop-up box appear when a box is checked. However, when I uncheck that box the pop-up appears again. Is there a way to disable that pop-up box if I want to uncheck that box?
if (this.getField("AtoA").value !="Off")
app.alert("The A2A contains all of this information in a different format. Are you sure this report is also needed?", 3);
So it's the Mouse Up script of the CommercialAuto check box, right? It seems that you also want to see whether it is selected or not, something like:
// If this check box is selected, display a popup if the AtoA check box is selected
if (event.target.value !== "Off") {
if (this.getField("AtoA").value !="Off") {
app.alert("The A2A contains all of this information in a different format. Are you sure this report is also needed?", 3);
}
}
This can be simplified to:
if (event.target.value !==
...Copy link to clipboard
Copied
Where did you place the code exactly, and could it be in more than one location?
Copy link to clipboard
Copied
If the AtoA box is checked, and someone tries to check this CommercialAuto checkbox, the popup will appear. The code is placed in the CommercialAuto checkbox.
Copy link to clipboard
Copied
So it's the Mouse Up script of the CommercialAuto check box, right? It seems that you also want to see whether it is selected or not, something like:
// If this check box is selected, display a popup if the AtoA check box is selected
if (event.target.value !== "Off") {
if (this.getField("AtoA").value !="Off") {
app.alert("The A2A contains all of this information in a different format. Are you sure this report is also needed?", 3);
}
}
This can be simplified to:
if (event.target.value !== "Off" && getField("AtoA").value !== "Off") {
app.alert("The A2A contains all of this information in a different format. Are you sure this report is also needed?", 3);
}
Copy link to clipboard
Copied
George, thank you for your help. That worked!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now