How to: set a multi-line default value in an InfoPath 2010 textbox field

That was a tricky one.

I have a textbox on an InfoPath 2010 form, into which, I want to display multiple lines of text.

Obviously, I set the field to allow multiple lines (textbox properties > display > multi-line) and then go back to input the text in the “Value” field on the “Data” tab of the textbox properties.

It doesn’t work.

As soon as I click on Enter, Shift+Enter, Control+Enter, …, the properties window closes. The default value of the textbox is set to whatever I have typed before pressing the Enter button.

It appears that only the following works:

Start a text editor.

Type in string(“”).

Between the quotation marks, enter the text that you want to display in the textbox field, exactly the way that you want it to be displayed (ie. in multiple lines).

Select and copy the entire thing.

Go back to your InfoPath form, click on the textbox properties, click the function button (fx) next to the default value field.

Paste into the function field everything you copied earlier.

Hit OK.

Problem fixed!

MGR: the Intelogist

About MGR: the Intelogist

SharePoint Server developer, turned Sitefinity developer, turned Angular developer, turned SharePoint Online consultant, turned Unily consultant, turned O365 consultant... Never a dull moment!

4 thoughts on “How to: set a multi-line default value in an InfoPath 2010 textbox field

  1. Pedro

    I finally got this to work.
    Thank you very much for your post.

    • MGR

      You’re very welcome Pedro. Happy to have been of help!

  2. Great one! Nice post!

  3. David

    Nice!! Thank you!! 😀

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.