Skip to main content
Aleksc1994
Participant
March 17, 2026
Question

how to have a checkbox to remove/add pages

  • March 17, 2026
  • 3 replies
  • 91 views

Hello, still a bit new to adobe and not really finding my answer.

Im trying to just have 2 boxes, one of the left for “Yes”, the other on the right for “No”

if the box on left is clicked, it would show pages 10-15, but if it is not clicked, it would delete those pages instead.

    3 replies

    Thom Parker
    Community Expert
    Community Expert
    March 18, 2026

    Nesa has the correct suggestion. To get this effect, the pages that are shown/hidden must be page templates. However, the show/hide action will only work on PDF viewers that support scripting. Basically the desktop Acrobat/Reader. 

     

     

    Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
    JR Boulay
    Community Expert
    Community Expert
    March 18, 2026

    Show/hide templates pages does not work with Acrobat Reader, it requires Acrobat Pro or Standard.
    For Acrobat Reader, templates pages must be spawned/deleted.

    Acrobate du PDF, InDesigner et Photoshopographe
    Thom Parker
    Community Expert
    Community Expert
    March 19, 2026

    Hey JR, I was using the terms show/hide rather loosely.  I of course meant spawn/delete.  Thanks for the correction. 

     

    Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
    william954
    Participating Frequently
    March 17, 2026

    You cannot do that inside a PDF. Acrobat forms do not add or remove pages based on a click.

    What you can do instead:

    Use show hide fields
    Create your Yes No checkboxes
    Then use JavaScript to show or hide content on those pages
    The pages stay there but content becomes invisible

    Or split the workflow
    Make two versions of the PDF
    One with pages 10 to 15
    One without
    Then direct users based on their choice

    Best practical option
    Keep one file and just hide the content instead of trying to delete pages dynamically

    Nesa Nurani
    Community Expert
    Community Expert
    March 17, 2026

    Did you make pages 10-15 into templates?
    What is the point of NO checkbox?
    So when YES checkbox is checked it would spawn pages 10-15 and if it’s unchecked it would delete those pages?