Skip to main content
Participant
July 21, 2023
Question

Only show checked boxes when saving form

  • July 21, 2023
  • 1 reply
  • 909 views

Hello Everbody. I have been working on a form for the Supreme Court in New York and have been asked to make a change that I am unsure how to do or if possible. 

 

Right now,  my form has several check boxes  and a javascript that generates text into a text field depending on which boxes are checked. The courts would like ONLY the checked boxes to appear  on the saved file when saving the document, without changing the original document- so this form can be used over and over for each filed case. 

 

Can somebody please help me

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
July 21, 2023

So you don't mean just the check boxes, you want the associated section to be hidden? It also looks like you'd prefer the visible sections to all stack up together without spaces in between? 

 I'm looking that part that starts on Page 3.  If this is not correct, then please indicate where the checkboxes are in this 70 page document.

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
July 21, 2023

correct, so starting with pages 3-6 there are options of potentially things that could be wrong with an uncontested divorce that is submitted to the court.  Right now I have created a javascript that depending on which text box is selected, it will display on page 2 in the box that says "You will need to fix this."   

 

What the court is asking is that once I have selected my options from pages 3-6, when I save the document, ONLY the options that have been selected will appear on the NEW saved document. if this makes sense? Also, I am re-attaching the file here with only pages 1-6 so it's less to look at. the rest are reference pages. 

Thom Parker
Community Expert
Community Expert
July 21, 2023

Thank you for posting the reduced document. 

So this is what I thought you wanted. Unfortunately the possible solutions are not as clean as you might like.  Content in a PDF cannot be moved dynamically. And there are limited ways to hide it. 

 

Here are some methods. 

 

1. It's easy to hide and show form fields and annotations, it's also easy to move annotations and form fields. So if you could place all of the section text into a couple of form fields and/or annotations, then a script could be written to hide everything that isn't checked and move the options so there are no gaps. I'd use a stamp for all the static content, so everything is one place. It might be tricky making sure the checkbox stays on top of the stamp. Hiding is the easy bit. Moving takes a bit more code for calculating the correct positions.  Here's a couple of relavant articles on the topic.

https://www.pdfscripting.com/public/Hiding-and-Showing-Form-Fields.cfm?sd=40

https://www.pdfscripting.com/public/PDF-Page-Coordinates.cfm

 

2. Actual page content can be hidden and shown with layers. But it can't be moved, so this method would leave gaps between the checked options. 

https://acrobatusers.com/tutorials/create_use_layers/

 

3. Convert this form to an Adobe AEM form. AEM forms, the forms previously known as LiveCycle, also called XFA forms, were developed exactly for this kind of thing.  These are dynamic forms where content can move around. They look like a PDF, but they are not a PDF.  The conversion will be a massive effort and the form will not work, or will not work correctly, in any viewer except for Acrobat Pro and Reader.   

 

Good Luck

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often