How to: Default Text with Line Returns in a Rich Text Box? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How to: Default Text with Line Returns in a Rich Text Box?

Last post 01-14-2013 10:54 AM by nkstrou. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-10-2013 12:28 PM

    How to: Default Text with Line Returns in a Rich Text Box?

    Hi all -

    I have an InfoPath 2010 filler form where I need a couple of rich text boxes to have default text with multiple lines (basically a 2-item list and a 3-item list).  The info in these text boxes will never be changed, I will be locking it down to read-only, and it doesn't need to go to SharePoint or anything tricky like that.

    I've already done some research and know I need to have Paragraph Breaks and Wrap Text turned on (check and check) and I've tried the suggestion that appears to work with older versions of IP to create a secondary data connection to an external XML file that contains the code for line feed (lf), carriage return (cr) and carriage return line feed (crlf).  I created an action rule to set my one of my rich text boxes with the text I need with an @crlf that I pull from the secondary data connection and add where I want the line returns to appear. (so concat("List item 1. ", @crlf, "List item 2. ", @crlf, "List item 3. ")).

    The rule sets my rich text box with the desired text, but alas, without the line returns - i.e. "List Item 1. List Item 2. List Item 3.", all on a single line. 

    Is there a different trick to doing this in IP 2010?

    Thanks,

    nkstrou

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
  • 01-11-2013 12:28 PM In reply to

    Re: How to: Default Text with Line Returns in a Rich Text Box?

    I got the same results as you with Rich Text Box....I even put a button on there & tried to "Set Fields Value" on click....no crlf. 

    If you can get by without the "Rich", I got it to work using a "text box" control with "Display > Multi Line" checked.(considering you're locking it to ReadOnly w/ fixed text....maybe you don't need it rich?).

    I have the secondary data connection for cr, lf, and crlf as you mentioned, so the default value of the "Text box" was:

    concat("LIst1", @crlf, "list2")

  • 01-14-2013 10:54 AM In reply to

    Re: How to: Default Text with Line Returns in a Rich Text Box?

     Good point.  I'd assumed I needed the rich text control in order to get the line returns to work in the first place (and I was also considering using bulleted lists), but I changed my controls to standard textboxes and my lists were both short enough that they fit (I'm thinking standard textboxes have a 255-character limit?). So I'll go with that!

     Thanks,

    nkstrou

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.