Carriage Return In Text Box - InfoPath Dev
in

InfoPath Dev

Carriage Return In Text Box

Last post 09-16-2019 12:49 PM by evans.justin.dev. 33 replies.
Page 2 of 3 (34 items) < Previous 1 2 3 Next >
Sort Posts: Previous Next
  • 03-18-2008 06:48 AM In reply to

    • HelenG
    • Not Ranked
    • Joined on 03-18-2008
    • Posts 1

    Re: Carriage Return In Text Box

    Did you find a solution / work around to this not working with Forms Services ?

  • 03-21-2008 02:17 AM In reply to

    Re: Carriage Return In Text Box

    Unfortunately, I wasn't able to find a solution. I found one possible workaround suggesting that I use the RTF control but that didn't work for me either.

     

    -Gil

  • 11-03-2008 05:40 AM In reply to

    • smods
    • Not Ranked
    • Joined on 08-06-2008
    • Posts 25

    Re: Carriage Return In Text Box

    Can I ask where I insert this code? I am a newbie to Infopath and need to get this working ASAP
  • 04-01-2011 08:26 AM In reply to

    • zanne
    • Not Ranked
      Female
    • Joined on 03-31-2011
    • Houston, TX
    • Posts 14

    Re: Carriage Return In Text Box

    I have a web enabled form and a repeating table with three columns.  I am using the double eval concat function in a Rich Text Control seperating each row of the table with a semicolon but would really love to have a line break at the end of each row.  I also added normalize-space to remove the whitespace InfoPath was adding at the start of  row 1. 

     Anyone have any luck on adding the line break on a web enabled form?

  • 09-08-2011 07:07 AM In reply to

    Re: Carriage Return In Text Box

    Because I could not get the characters.xml file method to work (I can concat a ">" between to fields, but not a carriage return), I tried this as well. I take it that the file with your Ctrl+Enter (between two " 's) was named "Carriagereturn. Nothing happened for me. To make sure the file was being added to the concat results, I then inserted "xxxx" inbetween two Ctrl+Enter's nested between two " 's. The "xxxx's" show up, but no line return. Any ideas?

  • 09-08-2011 07:21 AM In reply to

    Re: Carriage Return In Text Box

    It's difficult to understand what you are saying.  Could you describe the steps you took in more detail, maybe in a numbered list?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-08-2011 02:58 PM In reply to

    Re: Carriage Return In Text Box

    First, I tried creating an xml file in Notepad and referencing it in the InfoPath form. The file is called "characters":

     <?xml version="1.0" encoding="UTF-8"?>
    <characters
        cr="&#xD;"
        lf="&#xA;"
        crlf="&#xD;&#xA;"
    />

    field 1 = xxxxx
    field 2 = zzzzz

    I added the xml file as a data source and then concatinated "field 1", @cr, "field 2" (I also tried "field 1", @cr, @lf, @crlf, "field 2")

    What I got in my rich text field was "xxxxx zzzzz" every time

    What I want is: xxxxx
                           zzzzz

    I then tried creating a text field (field 3) in the form that is read only, allows paragraph breaks, and does not refresh. The default value of the field is Ctrl+Enter nested between 2 quotation marks. (The Ctrl+Enter was not typed, but actually entered, causing the second quotation mark to line up below the first one in the function view of the default value for the field. Using this file, I then concatinated "field 1", "field 3", "field 2" - same results.

     I then added  amp="&#38;" to the xml file and concatinated "field 1", @amp, "field 2"

    What I got in my rich text field was "xxxxx & zzzzz"

    This tells me that my file is pullin in the xml value from "characters.xml" for the &, but not for the carriage return/line feed.

    Hopefully this is enough information. My goal is to send this file to the SharePoint document library so that I can use Designer and create an e-mail that lists up to 38 different fields that need to be remediated by the user. I can't conditionalize the fields to say only bring in fields that aren't empty, hence trying to put them all into one field that I import into the e-mail notification for remediation. BTW, I try to stay as far away from code as possible.  :o)

    Comments/suggestions?

  • 09-08-2011 09:29 PM In reply to

    Re: Carriage Return In Text Box

    Hi dapklp,

       Thanks for the very detailed clarification.  Could you check your text box's properties to make sure that the multiline option is enabled?  Is this a browser form?  I think I remember there being a limitation with displaying multiline values on browser forms.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-09-2011 04:58 AM In reply to

    Re: Carriage Return In Text Box

    Through further experimentation, I was able to make it work. I put a character before and after the Ctrl+Enter and observed the results. With the rich text box, there is no property indicator for multi-line (specifically), so I created a duplicate text box and tried it there - Whala! It works with a text box, but not with a rich text box - go figure. Thanks for pointing me in the right direction. DAP

  • 09-09-2011 05:01 AM In reply to

    Re: Carriage Return In Text Box

    Oh, and BTW, we do not use Forms Server (browser forms)...this is with InfoPath as a desktop application. DAP

  • 09-09-2011 07:01 AM In reply to

    Re: Carriage Return In Text Box

    Yes, this makes sense.  Rich Text boxes are essentially HTML and line breaks in HTML don't mean anything when it is actually rendered.  There is probably not a way to put line breaks in a rich text box with just rules.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-13-2011 10:22 AM In reply to

    Re: Carriage Return In Text Box

    Now that I have a nice bulleted list in my text box...any ideas on how I can export if from the form so I can send that list to someone? If I push my field containing my list to the document library and then use Designer to forward it to someone in an e-mail, I am limited to 255 characters.

  • 09-13-2011 11:32 AM In reply to

    Re: Carriage Return In Text Box

    I received this response via e-mail, but I don't understand it and what I do understand I think is not applicable:

    "The XML file as a resource does work in browser forms. I have used this many time over the last several years. there are several you may want to check. One if the formatting of your XML file. the file must be saved in a UTF format because this is the XML standard. Also attach the file as a secondary data source within the form so it stays with the form and available at all times. When I first ran into this the biggest problem I had was either with the format of my XML file or how I attached it. When you add the @crlf, you do this the same way you insert a field from any data source. and lastly make sure your textbox allows multiple lines under the display tab"

    What I'm trying to do is consolidate 38 different fields into one field that I can use in an e-mail. I check field #1. If it is empty, nothing happens. If it contains data, I grab my destination field in the form and append this data as the first bullet. I then check each of the 37 other fields and each one that contains data pulls the destination field and appends the data as an additional bullet. This works fine with a text field (I get 38 bulleted items, each on a separate line), but I can only send the first 255 characters in a text field to my document libray in SharePoint. I can send unlimited characters using a Rich Text Field, but I can't get my 38 sets of data to appear on separate lines. My form is not browser enabled, there are no attachments, and my destination field is configured to display multiple lines. I don't know what format InfoPath uses to save the XML file in the document library. Hope that clarifies.

    I could send each of my 38 fields separately to my document library, but I cannot selectively insert only populated fields into an e-mail using SharePoint Designer. If 37 were blank and only 1 was populated, I'd end up with a lot of unnecessary white space in my e-mail. DAP

  • 07-08-2013 06:44 AM In reply to

    Re: Carriage Return In Text Box

     I would be curious to know how you get a bulleted list, txt box or rich text?

    Kind regards,
    Larry
  • 04-04-2014 02:59 PM In reply to

    Re: Carriage Return In Text Box

    I am not sure if this is necessary, or even relevant anymore, but I wanted to get my fix somewhere on the interwebs after spending about two days trying to make this work. This is a very low tech solution. Using: Infopath 2010, with SharePoint 2010. On: Custom list Goal: Create a button, that when pressed, will generate a template in a text box for my agents to copy and paste. Primary issue was getting line breaks/carriage returns Solution: Create a text box which stores a carriage return, and then use that box whenever you want said return in your template builder. 1. Create a plain text box labeled 'Line Break' 2. Create a plain text output box (mine was labeled: Templates) 3. Create a button, label it whatever, and set it to run rules So, I have two boxes that are being used, and one button. The button, for example will say 'Triage Template'. When this button is pressed, two rules run. Rule 1 will Set a fields value. Field: Line Break Value: string("ctrl+enter") (To be clear, you will not type that exactly, you will actually hit the control and enter keys at the same time inside of your " ", this will add the line break) Rule 2 will Set a fields valud Field: Templates Value: concat(field1,LineBreak,Field2,"Text",field3) The line break in that expression being the field you set to ctrl+enter in rule 1. I have looked at many ways to do this, including creating an xml document and uploading it to sharepoint (which subsequently will not work with my parameters). I have not seen this solution online, so I thought I should put it somewhere. Good luck all!
Page 2 of 3 (34 items) < Previous 1 2 3 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.