Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to move text field info to another section or a Word Doc.

Avatar

Former Community Member

I am trying to figure something out and I am having trouble.

I have a series of text fields that I want my students to fill out. I would like it so as they fill it out it puts that text together from all of those boxes into one paragraph either somewhere else on the form or in Microsoft Word.

It would be nice if they could push a button and it combine the fields into a paragraph.

Is this possible?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 6

You've got it right.  The form is saved as a static pdf, so it is prevented from changing when you are viewing it in Reader.  If you want an interactive form it needs to be saved as a dynamic form.  Re-save the form as a dynamic PDF (Save As from the menu, and choose Save as Type: Adobe Dynamic XML Form).  It should work fine after that.

View solution in original post

20 Replies

Avatar

Level 6

Pushing everything to a separate section is no problem.  As far as I can tell, pushing to a Word doc is not possible, but the text from the assembled block can be copied and pasted into Word.

I've attached a sample form.  There are three text fields for a user to enter sentence parts.  Then there is a large text box on the bottom with three floating text fields, each of which corresponds to one of the entry text fields and is named the same.  All fields are set to Global data binding, so when one data field is changed any field with a matching name will also change.  Because of this when text is entered in a user-entered field, the corresponding floating text field in the large box will be updated with the same text.  Using floating fields will allow the text in the large box  to adjust to the changing sentence lengths.

The only caveat with this scheme is that you need to include the following JavaScript in the "exit" event for each data entry text field:

xfa.layout.relayout();

This is because the form will not automatically re-draw the floating fields in the large text box when the text changes; using the script will force the re-draw and the the form will refresh.

This scheme should be easy to modify for your needs.

Avatar

Former Community Member

Ok, this is a great help

But how do I

"The only caveat with this scheme is that you need to include the following JavaScript in the "exit" event for each data entry text field:

xfa.layout.relayout();"

How do I set that?

Avatar

Level 6

It's already done in the example that I sent.  When adding a new text field:

    

  1. Click on the new field
  2. In Designer's scripting area, in the upper left side where it says "Show:", pull down the dropdown and select the "exit" event.
  3. Enter or paste the javascript code in the scripting text area
  4. In the upper right side where it says "Language:", pull down the dropdown and select "JavaScript".

If you open up the sample in Designer and click on one of the text fields you will see an example of this.

Avatar

Former Community Member

Another Question

The form I have is six pages long.

I see that I will need to wrap the text boxes in a subform. Can the subform extend past 1 page. I cant seem to get it to extend past 1 page.

What I mean is that one text box will be on Page 1, but the page where it will put it all together may not be until page 6.

Thanks again,

Avatar

Former Community Member

I click on the object and then go to WINDOW - SCRIPT EDITOR and then I see the

SHOW drop down menu. I click on Exit and I do not see that code pasted on your text boxes.

Not sure?

Avatar

Former Community Member

Ok, Ive figured how to add the JavaScript,

but, I still need to figure out how to have text on pages 1-2-3-4 submit to the textbox on the last page.

Do I need to wrap in a subform or something?

Thanks again,

I am almost there!

Avatar

Former Community Member

Hmmm...

I cant seem to replicate what you did after all.

I started from scratch

I added a Text Field

I labeled it in BINDING to T1 and set it for Global

I then went to the script exit menu and added that code you sent me - xfa.layout.relayout();

Then I added a text field below and right click in it to add a floating field (I think that is how you did that)

Then set the BINDING to T1

Then I saved it and open it in Acrobat and it did not work.

Avatar

Level 6

You have a couple of options for this.  I don't know what your final form needs to look like.

First, it doesn't matter what page the text box is on.  As long as the floating field inside the text box is named the same as its corresponding fill-in field, and both are set to Global binding, the data will transfer.

If you need to do things page-by-page (that is, certain fields must be on a particular page) then you should continue with the way the form was started.  Use positional layout and you will have one subform per page.  To add a new page, in the hierarchy right-click on the (page 1) subform and then select New Page from the menu.

If you don't need to have things on a particulary page, then you can change the (page 1) subform to flowed content, and then things will flow from page to page as space allows.

Avatar

Correct answer by
Level 6

You've got it right.  The form is saved as a static pdf, so it is prevented from changing when you are viewing it in Reader.  If you want an interactive form it needs to be saved as a dynamic form.  Re-save the form as a dynamic PDF (Save As from the menu, and choose Save as Type: Adobe Dynamic XML Form).  It should work fine after that.

Avatar

Level 10

I just want to clarify a few things.

"The form is saved as a static pdf, so it is prevented from changingwhen you are viewing it in Reader. "

Static doesn't mean it's not interactive. A static xdp means that once it's rendered, you won't be able to dynamically change the template (add pages, subforms, etc).

"If you want an interactive form it needs to be saved as a dynamic form."

You can get an interactive form whether it is saved as static or dynamic xdp.

It's more the service that renders the xdp that decides whether or not it interactive. LiveCycle Output will create non-interactive PDF and LiveCycle Forms will create interactive PDFs.

Jasmin

Avatar

Former Community Member

You guys are great! That has helped me so much, you have no idea.

Thanks again!

Avatar

Level 6

You're right Jasmin, I should not have been so simplistic in my definition of interactive.  Thanks for clearing it up.

Avatar

Former Community Member

ONE LAST PART !

I have figured it all out, but have hit a snag.

After the kids type their sentences in, they may have more than one page of text. They may even have 4-5 pages of text. However, the text box I can make (where all the text goes into) is only a page.

What can I do about that?

Avatar

Level 6

Your form needs to be built using flowed content layout rather than positioned.

Also, select the large text box and on the Object panel/Draw tab, make sure "Allow page breaks within content" is checked.

Avatar

Former Community Member

Can I switch this at this poinbt without starting over?

Where do I set that?

Avatar

Former Community Member

The Allow Page Breaks Button is not available to be pressed.

Do I need to swticth to flowable layout first?

Where can I do that?

Avatar

Former Community Member

Ok, Ive wrapped the final page in a subform and then it allowed me to highlight the Page Break button.

However, it still istn expanding the document. It cuts off the words at the bottom of the page.

Avatar

Former Community Member

Ok, my final goal is to have the area where the text is moved (2nd page) extend if

the writer ends up writing more than one page of text.

How can I do this?

Ive attached a pdf

Thanks for all your help!

Avatar

Level 6
  1. Select the Page 2 subform :
    • Change its Content to Flowed.
    • Make sure the "Allow Page Breaks Within Content" checkbox is checked.
  2. Select the Text1 object:
    • Make sure the "Allow Page Breaks Within Content" checkbox is checked.
    • Select the Layout tab and check the "Height: Expand to Fit" checkbox.
  3. Make sure your preview type is set to Interactive Form.