Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is it possible for a fillable form user to click a button that will allow the entire page to copy to a new page?

Community Beginner ,
Jan 13, 2017 Jan 13, 2017

I have a fillable form that our salespeople fill out with specifics for a certain door that needs to be ordered.  I would love for the salesperson to be able to click a button at the end of the document called "add another door" that will add another page exactly like the first. This new page, however, will have the customer information copied (name, address, etc), but the rest of the form fields will be cleared so that a new door can be filled in. The idea is that the salesperson can be at a customer's house and use one form to complete the necessary information for multiple doors at one address.

Thanks so much for your help.

TOPICS
Acrobat SDK and JavaScript
384
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2017 Jan 13, 2017

Yes for Acrobat and versions of Reader XI or newer using the template object and spawning templates.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 13, 2017 Jan 13, 2017

That's awesome. I actually think I just stumbled across your script to do this:

// Duplicate the current page 

createTemplate("t1", pageNum).spawn({nPage: pageNum + 1, bOverlay: false}); 

removeTemplate("t1"); 

The problem is that I can't seem to figure out where to put it now. I have added a "add another door" button and put as an action under "run a javascript," but it's not working yet.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2017 Jan 13, 2017

Have you tried the action for the button. You will create a copy of the form page including the field values and keeping the field names the same as the field names on the page will mean as you change the field values on the new page they will change on the source page.

Have you opened the Acrobat JavaScript console to see if there are any errors in your code. I find it is best to create a template for the page of a form I want to duplicate at a later date.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2017 Jan 13, 2017
LATEST

You may also encounter issues with your calculations using this approach.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines