How to line break in a textbox

Avatar

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
MTremblay-Savar
Level 2

06-11-2013

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

Accepted Solutions (0)

Answers (17)

Answers (17)

Avatar

Avatar
Level 1
dylans17538794
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
dylans17538794
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
dylans17538794
Level 1

02-10-2020

Try using this tool for all of your line break needs!

https://apps4lifehost.com/Instagram/CaptionMaker.html

Hope this helps 

Avatar

Avatar
Level 1
blahbap
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
blahbap
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile
blahbap
Level 1

11-09-2014

What we're talking about here is not formatting the string in Javascript, but formatting a string that is passed into the form via a data connection. The value of the text field in the form is bound to the string in the data view. 

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

10-09-2014

Hi,

to add a new line into a text field use \n within the string.


textField1.rawValue = "This\ntext\ncontains\nlinebreaks.";


Avatar

Avatar
Level 1
blahbap
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
blahbap
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile
blahbap
Level 1

10-09-2014

Hi MTremblay-Savard,

I am trying to achieve the same as you without success - could you show be exactly what your string looks like?

thanks!

Frank

Avatar

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
MTremblay-Savar
Level 2

07-11-2013

I found the solution!

I've put the ascii code for "new line" into my string where i wanted it to line break and i've pushed my string into the textbox using the data binding and it worked like a charm.

Thanks for all your help Justin!

Max

Avatar

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
MTremblay-Savar
Level 2

07-11-2013

XML Schema

In which event should i put your code?

Avatar

Avatar
Validate 1
Level 1
Justin_Klei
Level 1

Likes

3 likes

Total Posts

33 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
Justin_Klei
Level 1

Likes

3 likes

Total Posts

33 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Justin_Klei
Level 1

07-11-2013

In Designer, go to the Data View tab.  You should see a data connection.  Right-click on the data connection and select "Connection Properties".  The "Data Description Type" will tell you the type of data connection.

Avatar

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
MTremblay-Savar
Level 2

07-11-2013

Do you know how i can know which type of data connection i have defined?

Avatar

Avatar
Validate 1
Level 1
Justin_Klei
Level 1

Likes

3 likes

Total Posts

33 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
Justin_Klei
Level 1

Likes

3 likes

Total Posts

33 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Justin_Klei
Level 1

07-11-2013

I'm not familiar with the SAP integration, but I'm pretty sure it's using the LiveCycle Forms module to render the form.

What type of data connection do you have defined in Designer?  It has to be one of the following:

  1. XML Schema
  2. Sample XML Data
  3. Data Model
  4. WSDL File
  5. OLEDB Database

I'm guessing it is 1 or 2, in which case the instructions I gave you above for exporting the XML data would still apply.  You just need to make sure the data in SAP looks like whatever is in the exported XML file.

Avatar

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
MTremblay-Savar
Level 2

07-11-2013

I am filling the context of the form using adobe livecycle designer integrated to SAP.
11-7-2013 10-44-52 AM.png

Avatar

Avatar
Validate 1
Level 1
Justin_Klei
Level 1

Likes

3 likes

Total Posts

33 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
Justin_Klei
Level 1

Likes

3 likes

Total Posts

33 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Justin_Klei
Level 1

07-11-2013

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?

Avatar

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
MTremblay-Savar
Level 2

07-11-2013

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.

Avatar

Avatar
Validate 1
Level 1
Justin_Klei
Level 1

Likes

3 likes

Total Posts

33 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
Justin_Klei
Level 1

Likes

3 likes

Total Posts

33 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Justin_Klei
Level 1

07-11-2013

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.

Avatar

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
MTremblay-Savar
Level 2

07-11-2013

Hi Justin,

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

Avatar

Avatar
Validate 1
Level 1
Justin_Klei
Level 1

Likes

3 likes

Total Posts

33 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
Justin_Klei
Level 1

Likes

3 likes

Total Posts

33 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Justin_Klei
Level 1

07-11-2013

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);

Avatar

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
MTremblay-Savar
Level 2

Likes

2 likes

Total Posts

63 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
MTremblay-Savar
Level 2

07-11-2013

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

Avatar

Avatar
Validate 1
Level 1
Justin_Klei
Level 1

Likes

3 likes

Total Posts

33 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
Justin_Klei
Level 1

Likes

3 likes

Total Posts

33 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Justin_Klei
Level 1

07-11-2013

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