Reputation: 323
I want to create a checklist in PDF format using Adobe Acrobat.
It is a simple checklist (with predefined texts, not expected to be changed), but I would like it to have the following interactive behaviour: Whenever a checkbox is checked, the text to the right (which describes the task to be done) changes its font colour (from black to grey, for instance); and the other way around: whenever a checkbox is unchecked, the corresponding text gets back to its initial state. If this is not possible, then making appearing/disappearing a strike-through line would be also a valid solution. How can this effect be achieved?
I have read about using Adobe Acrobat to create forms starting from any kind of document (here, for example: https://helpx.adobe.com/acrobat/how-to/convert-word-excel-paper-pdf-forms.html). But I do not know whether what I want to do is possible or not, using this tool.
Upvotes: 0
Views: 770
Reputation: 3615
With the right field naming strategy, this is pretty easy to implement. Therefore, I suggest to NOT use any automatic form creation functionality from Acrobat.
What you will create are sets of checkbox and corresponding (multiline, maybe rich text) form fields. Using hierarichal field names, the checkbox for the first entry of the checklist could be named cl.1.ckb
, and the according text field cl.1.txf
.
The color change logic would look like this (not verified; for errors, I will stand corrected):
In the MouseUp action of the checkbox add the following code:
var mytxtf = event.target.name.replace(/\.ckb/gim, ".txf") ;
if (event.target.value == "Off") {
this.getField(mytxtf).textColor = color.black ;
} else {
this.getField(mytxtf).textColor = color.gray ;
}
and that should do it. This code is independent of the field names, and can therefore be added to all text boxes without modification.
Upvotes: 1