Skip to main content
Participant
May 7, 2026
Question

JavaScript button to spawn new fillable form pages only works for some people

  • May 7, 2026
  • 2 replies
  • 19 views

Hello,

I have a form with a button to add new fillable pages when clicked. Most people can click the button and the new pages show up. There are a few people who click the button and nothing happens. I’ve verified they are opening the form in either Adobe Reader or Acrobat and that JavaScript is enabled. Are there other things I can check?

Trish

    2 replies

    Thom Parker
    Community Expert
    Community Expert
    May 7, 2026

    Yes, are all the failures in Reader or Acrobat, or is it mixed? 

    Are there differences in the Acrobat security preferences between the systems? Such as protected mode?

    Are any errors reported in the Console Window?

     

     

    Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
    Bernd Alheit
    Community Expert
    Community Expert
    May 7, 2026

    What script do you use at the button?

    Participant
    May 7, 2026

    // Get a reference to the template

    var t1 = getTemplate("1-1");

    // Create a new page, but only if there's currently only one page in this document;

    if (numPages == 7) {


         t1.spawn({nPage: numPages, bRename: true, bOverlay: false});

    } else {

        // Do nothing, since the page has already been added

    }