Skip to main content
Participating Frequently
July 4, 2016
Answered

Needing help with different kinds of conditional logic in a custom PDF

  • July 4, 2016
  • 1 reply
  • 1094 views

Ah the life of a developer - get handed something that a non-computer geek thinks is "easy" with an unrealistic timeline, and you've never done it before 🙂

I have been asked to take a custom-PDF built by someone in my group and make some changes.  I'm running Win7 and using Adobe Acrobat Pro DC.

What I need to do is basically variations around Conditional Logic; for example:

     If Checkbox1 is filled in, Checkbox2 becomes locked

     If Checkbox1 is filled in, ComboBox2 becomes mandatory

     If the user has filled out the PDF, saved it as "Customer_0123", and goes back in to make changes, can I highlight what was changed?

I am (very very) new to JavaScript and so I have been muddling through some documentation but the "most recent" document I have found from Adobe is 10 years old, and I'm not sure it's still relevant.

Any help would be appreciated...

Thanks

Chris

This topic has been closed for replies.
Correct answer try67

The best way of associating scripts with check-boxes is to use the MouseUp event. In that event you can access the field's new value via event.target.value.

And yes, that's correct re the JS Console.

1 reply

try67
Community Expert
Community Expert
July 4, 2016

The code didn't change that much in the last 10 years, so what you found could still be relevant. The main difference could be how to access the fields and their actions. If you need help with that let us know.

The first two requests are relatively easy. The last one is not very clear... There's no "track changes" feature in PDF files, if that's what you mean.

Participating Frequently
July 4, 2016

Thanks, this helps a lot.  I wasn't sure if I could have something in JavaScript where it said "on edit" or some such thing.  Can I lock the fields on Save?  If I can do that, then I can add the fields that could potentially change into a "Revision" section.

One other question that I've just come across, which is more high-level  (and based on your comment :-)).  I'm assuming that the Console view (CTRL-J) would be for document-wide javascript or doing hardcore coding / testing, and then the Actions tab with "Run A JavaScript" would be for field-specific actions (such as I'm doing)?

Thanks again!

Chris

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
July 4, 2016

The best way of associating scripts with check-boxes is to use the MouseUp event. In that event you can access the field's new value via event.target.value.

And yes, that's correct re the JS Console.