Copy link to clipboard
Copied
Hello,
I have a simple PDF that has several checkboxes on it. What I'm wanting to do is have a specific PDF open depending on what checkboxes get checked (users clicks on a "Submit" button when done selecting forms). So, let's say the checkbox for form 026 is checked (026Cb), and so is the checkbox for form 053 (053Cb), but nothing else, then open an already saved PDF packet that has just those two forms in it. I added code that just dislays a message for now and get it to work for one checkbox check, but keep getting errors when trying to add more checkboxes to it. This will basically be a big nested if/else type check. Here is what I have.
if (this.getField("026Cb").value != "Off")
{app.alert("026 Checked", 3);}
else {app.alert("026 not Checked", 3);}
Copy link to clipboard
Copied
You have multiple errors in your code.
1. The OR operator in JS is "||".
2. There's no such command as fopen in Acrobat JS.
3. Your file-path syntax is incorrect.
Try this:
app.openDoc("/S/shz_online_agreements/site_files/packets/066p_PAF.pdf");
Copy link to clipboard
Copied
What errors are you getting? What code are you using?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You have multiple errors in your code.
1. The OR operator in JS is "||".
2. There's no such command as fopen in Acrobat JS.
3. Your file-path syntax is incorrect.
Try this:
app.openDoc("/S/shz_online_agreements/site_files/packets/066p_PAF.pdf");
Copy link to clipboard
Copied

