How to line break in a textbox | Community
Skip to main content
Nov 6, 2013 7:53 PM UTC
Question

How to line break in a textbox

Hello guys(and girls),

     Does anybody know a way to line break within a textbox? I am dynamicaly filling a textbox using a string and i was wondering if there is any "code" or <tag> i could put into my string to tell the texbox to line break?

     Textbox is set to allow multiple lines and field format is Rich text.

Thanks alot!
Max

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

17 replies

Level 2
Nov 7, 2013 3:39 PM UTC

What kind of data source...is it an XML or XSD?

How are you populating the data into the form?  Are you using LiveCycle Forms or LiveCycle Output?

Translate
Nov 7, 2013 3:26 PM UTC

No i mean, My textfield is currently data bound to a field in the Data View. This way it is dynamical. I am not manually filling this field.

Translate
Level 2
Nov 7, 2013 3:08 PM UTC

Are you trying to write script to populate the line break, or do you want to know how to generate the XML that gets fed into the form so the line breaks will appear?

The instructions I provided above will show you how to script it.

If you want to know what the XML should look like, do this:

  1. Save your form as PDF (not XDP)
  2. Open the form in Acrobat Pro (if you don't have Acrobat Pro, download and install the trial version from Adobe.com)
  3. Fill out the field(s) in the form
  4. Select Tools-->Forms-->More Form Options-->Export Data
  5. Save the XML file

You can then test out different variations of the xml file and use the Import Data option to import the xml into the form.

Translate
Nov 7, 2013 2:55 PM UTC

Hi Justin,

Thanks for your input but what if my string is coming from the data binding?

Translate
Level 2
Nov 7, 2013 2:50 PM UTC

Apparently the tags are getting encoded when you try to set the rawValue of the field.

Try this instead:

var richTextValue = '<body><p>Line 1 of text</p><p>Line 2 of text</p></body>';

xfa.resolveNode("TextField1.value.#exData").loadXML(richTextValue);

Translate
Nov 7, 2013 2:30 PM UTC

Hi Justin,


I thought too this answer would work but all i get outputted is this :

Some text that should end at this point. <br> Second line of this text. <br> Third line,

Any ideas?

Thanks!
Max

Translate
Level 2
Nov 7, 2013 2:23 PM UTC

If it's a rich text field, you can use an html <br> tag.

This is mentioned in the XFA Specification document:  http://partners.adobe.com/public/developer/en/xml/xfa_spec_3_3.pdf

Translate