« Rich or Reach, pick one | Main | Script and Link in SharePoint CQWP XSL Style Sheet »
Friday
Apr222011

Line break in InfoPath web browser forms

Microsoft once mentioned a line break trick using rules in InfoPath.

http://blogs.msdn.com/b/infopath/archive/2005/03/04/385577.aspx

The main problem we're trying to dodge is being able to insert a special character 
 (which is the chr(10) character), without InfoPath trying to be helpful and further encode our string.

image

Step 1: Create XML file

image

Step 2: Add secondary connection

image

Step 3: check it's now available in your secondary datasource

image

image

Step 4: when you need a newline character, insert it from the XML file.

Step 5: In InfoPath, you need to use the Textbox control, and enable multi-line.

 

Preview

image

Figure: Preview in InfoPath Filler

 

If you publish to web, it will use a TextArea element, which supports the line break.

image

Figure: Via Form Server

image

Figure: Textbox rendered as textarea element

Notes

You can set the textbox to read-only if you want to use it like a label.

Reader Comments (1)

I tried this in browser enabled form and it didnt work. Whereas the below steps worked for me

Add rule action as concat("123123", "
", "56456456456456456546")
* save and close
* Export as source files
* open manifext.xsf in a text editor, find rule change "
" to "
"
* Save the file
* Publish the form

March 28, 2012 | Unregistered CommenterArul

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>