Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

How to get expandable text fields within text?

Avatar

Level 1

I have a legal document I am trying to create that has text and within the text a client can type their name. I want to know if it is possible to have a text field that is expandable and that also moves the text to accommodate the entry from a client?


I am fairly new with liveCycle so any help would be greatly appreciated.

I also can't find where to upload an example of the form I am working on...

HELP!

5 Replies

Avatar

Level 7

I've struggled with this a few times, and at no point do I ever feel like I've handled this the "right" way. However, here are the options I've tried.

1. Structure the document so that anywhere something is filled in, an entire line can be dedicated to a user's entry.

2. Provide a page that is nothing but fillable fields. On that page, ask for whatever answers you need. Then, on the subsequent pages, make your text value reflect the concatenation of the text before what the user enters, the text the user enters, and the text after. You could feasibly have a LOT of text here. In fact, you could have a few blanks to fill out and then generate the ENTIRE document from what's entered there.

Ex: (There are probably better ways to do this.)

On p1, there are four fields and a button. tfName, tfAddress, tfCity, tfState, and btnGenerate. On p2, there is only a text field that is expandable: tfResult.

The javascript for btnGenerate::click looks like this:


xfa.resolveNode("p2.tfResult.value.#text").value = "My name is "+tfName.rawValue +". I reside at "+tfAddress.rawValue+" in "+tfCity.rawValue+", "+tfState.rawValue+".";


Avatar

Level 1

When you say "expandable text fields", you aren't talking about choosing the "wrap" option?

Avatar

Level 7

*I realize now that I'm saying text field for what I used in the example, but LiveCycle calls it just "Text." Henceforth, I'll call it a text area to reduce confusion.

Well, in my example p2 is a flowed page, and for the text area I checked the box for "Expand to fit" under Height. Then, just as a proof of concept, I changed the "=" to "+=" so that each time I click "Generate" I get more text in that area. Then I kept clicking until I got past the point that the page would fill up. Eventually, a third page was dynamically created to accommodate the extra text. If I were to keep going, it would just keep generating more pages.

I don't know if that answers your question, but for a text area, I don't see an option to "wrap." Here are relevant screenshots of p1, p2, and layout settings for tfResult.

740168_pastedImage_2.png

740171_pastedImage_0.png

740169_pastedImage_3.png

740170_pastedImage_4.png

Avatar

Level 1

Thank you for that explanation... I understand how to do that... Perhaps I didn't phrase/word my problem correctly...

Below you will find an image of my document rough draft.

In the first paragraph it states the petition of [text field] respectfully represents that on [text field], an Order of Court was entered for the support of

In the text fields the person completing the document would put their name if the first field and the date of the order in the next field. Everything before, between and after are just plain text.

My question is, is there  a way to have everything after (text field and text) expand with the users input and then again in the second field to have everything after expand after the user's input?

Untitled.jpg

Avatar

Level 7

That's how I understood your issue. I've not found a way to do what you're asking. In order to accept user input, you need a text field. You can make the text field expand horizontally, and that will carry the next bit of text (let's say in a text area) over a bit to match the expansion of your text field. Unfortunately, it can't line wrap, so it has to either all fit or drop down to the next line.

I hate to suggest a different program, but MSWord can do what you're asking with fillable text fields. You would replace those blank spaces with a text field that fits inline, and then protect the document so that only the text fields can be modified. But, it's not a PDF, and if you did export the document to a PDF, it would no longer be fillable.