Expand my Community achievements bar.

SOLVED

How do you create a new page when user checks a box?

Avatar

Level 3

I guess it would be a check box.  I'm looking for a way to have the user select create a new page when the user runs out of space in the text box that is given.  So if its possible is there a way to create a new page with a continuing text box when the user has selected the create a new page check box.  Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Yes, if you create a new page in LC Designer (page2), and deselect the min. count, so that when the form renders initially, there isn't an instance of the page. Then the click event of the button would be:

_page2.addInstance(true); 

You can design page2 with what ever objects you want.

Hope that helps,

Niall

View solution in original post

6 Replies

Avatar

Level 10

Hi,

You can achieve this by just making some changes to the textfield (and the page layout).

First, select the textfield and then in the Layout palette, tick 'expand' height to fit'. When you preview the form, you will see that as you type information into the field, a scroll bar will appear. When you exit the field, it will expand automatically to display the full contents.

Now the problem will be that the textfield will expand over objects that are positioned below it - not good!

So what you need to do is set up your form for a flowed layout. First select all of the objects that do not grow in size and wrap them inside a 'positioned subform'. When you select the subform you can see this setting in the Object > Subform palette. You should name the subforms in the hierarchy. So you will end up with a positioned subform above your textfield and a positioned subform beneath your textfield (if you have objects beneath it).

Then select page1 in the hierarchy and in the Object > Subform palette, change the content to 'flowed'. Hopefully the layout won't change too much (because you will have most of your objects in their positioned subform).

Last step is to select the textfield and in the Object > Field palette tick 'Allow page breaks within content'. This tells Acrobat/Reader to split the object if it overflows onto a new page.

Now save the form as a Dynamic XML Form in the save as dialog and previewed it. Now when the textfield expands it will push objects beneath it down. Also when it gets to the bottom of the page, it will start a new page automatically and continue the content on the new page.

Here is an example:

https://acrobat.com/#d=kwa4t2vu6mXbgMCyqEF0aQ

Paul Guerette is giving an online tech talk on dynamic forms on the 30 November, which I would recommend. Details here:

http://acrobatusers.com/events/49326/tech-talk-developing-flowable-form-content

Hope that helps,

Niall

Avatar

Level 3

This is a very helpful answer and is probably something I can use in the future.

Is there a way to create a button or something that can create a new page.  I think the design of t

his form I'm working on now the script you sent won't really work with it.  The customer actually want

s a way for the user to be able to create new pages.  So for example, the user enters in the background information on som

ething in the alloted text box but if more room is needed they can add a new page, made 2 or 3 pages

.  Is it possible to send the script as well, I'm working on the intranet for the actual form so I can't read the code.  Thanks so much.

Avatar

Level 10

Hi,

If you set the page (in this case named 'page1') to allow repeats in the Object > Binding palette:

2010-11-09_18-16-52.png

Then the following Javascript in the click event of the button should duplicate the page:

_page1.addInstance(true); 

Note the underscore (_) in front of the object name is shorthand for instanceManager.

Good luck,

Niall

Avatar

Level 3

Thank you, that's exactly what I'm looking for. Now one more questions...sorry.  Is it possible maybe to create a whole new page that is different, like just a page with a large text box to continue typing??  Thanks.

Avatar

Correct answer by
Level 10

Yes, if you create a new page in LC Designer (page2), and deselect the min. count, so that when the form renders initially, there isn't an instance of the page. Then the click event of the button would be:

_page2.addInstance(true); 

You can design page2 with what ever objects you want.

Hope that helps,

Niall

Avatar

Level 3

Thanks for your help...this is PERFECT!!