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 1 of 3 (34 items) 1 2 3 Next >
Sort Posts: Previous Next
  • 09-06-2005 03:18 PM

    Carriage Return In Text Box

    Hi There, :)

    What i want to acheive is:
    Collect data from several separate feilds and insert them into single text box, on separate lines.

    Simply using a rule with concat(feild1, feild2) works but i cannot add a carriage return, line feed in this way.

    Any help would be appereciated :)
  • 09-07-2005 01:29 AM In reply to

    Re: Carriage Return In Text Box

    Hi GtUtHill and welcome to our forum,
    XPath should support this, but I can't get it to work with special things lie #10. You could just put a function in code to do it. It may be that InfoPath prevents escaping via the Fx dialog.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 09-07-2005 03:41 PM In reply to

    Re: Carriage Return In Text Box

    Hi Patrick,

    Thanks for your reply.
    could you please post some sample function in code? I do not have a great deal of coding experience so some extra detail would be appreciated :)

    Many Thanks
    Greg Tuthill
  • 09-07-2005 09:16 PM In reply to

    Re: Carriage Return In Text Box

    Hi Greg Tuthill,
    Here is the code sample to append text from two nodes into a third node with carriage return,

    //Get Node1 value
    var field1Value = XDocument.DOM.selectSingleNode("/my:myFields/my:field1").text;

    //Get Node2 value
    var field2Value = XDocument.DOM.selectSingleNode("/my:myFields/my:field2").text

    //Assign the combined text into the third node.
    XDocument.DOM.selectSingleNode("/my:myFields/my:field3").text = field1Value + "\r\n" + field2Value;

    Hope this Helps!

    Agni
    InfoPath Dev India
  • 09-07-2005 10:35 PM In reply to

    Re: Carriage Return In Text Box

    Thanks Agni!!

    That works just fine!
    :)

    Greg
  • 09-27-2005 03:02 AM In reply to

    Re: Carriage Return In Text Box

    how to know is what myFiel is TextBox or DropDownList

    Landolsi
    Developpeur .NET
    Developpeur Php

    skype : mlaipsorg
  • 09-27-2005 08:01 PM In reply to

    • whapakk
    • Not Ranked
    • Joined on 09-23-2005
    • Philippines
    • Posts 22

    Re: Carriage Return In Text Box

    If you are not that comfortable with script (like me!)
    You can use rules.

    create an xml file which consists of the following:

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

    then add a recieve data connection to your form using the xml file. now you can use the carriage return on your formula builders by pointing to those fields.

    ex. concat(field1, @crlf, field2)
  • 09-29-2005 10:54 PM In reply to

    Re: Carriage Return In Text Box

    Very cool response. Thanks Whapakk!

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 04-17-2006 08:21 PM In reply to

    • lxhiss
    • Not Ranked
    • Joined on 12-12-2005
    • Posts 9

    Re: Carriage Return In Text Box

    Guys,

    Don't forget the & inside the quotes:

    Should read #
    btw fantastic solution.

    quote:
    Originally posted by whapakk

    If you are not that comfortable with script (like me!)
    You can use rules.

    create an xml file which consists of the following:

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

    then add a recieve data connection to your form using the xml file. now you can use the carriage return on your formula builders by pointing to those fields.

    ex. concat(field1, @crlf, field2)

  • 04-19-2006 10:28 PM In reply to

    Re: Carriage Return In Text Box

    There's another even better way to do this using eval. Check out last week's InfoPath Team blog entry:
    http://blogs.msdn.com/infopath/archive/2006/04/05/569338.aspx

    This is a must-read post by David and Ned.
    Patrick Halstead
    Project Manager at Qdabra
  • 04-24-2006 01:45 PM In reply to

    Re: Carriage Return In Text Box

    For some reason I could not get the XML file to work. However, using a text box formatted for paragraph breaks, read only, and set to not recalculate, I was thereby able to put in the formula box a CTRL+ENTER between two " which worked perfectly in the concat statement. (i.e concat(field1, Carriagereturn, field2)
  • 08-05-2006 06:36 AM In reply to

    • mattlight
    • Not Ranked
    • Joined on 07-30-2006
    • United Kingdom
    • Posts 15

    Re: Carriage Return In Text Box

    I've just posted a problem with carriage returns in a form text box which is pulled from an access databased that does show the carriage returns. How do you get it to display the data as it is in the database?

    Thanks
  • 03-14-2007 02:18 PM In reply to

    • ek38
    • Top 200 Contributor
    • Joined on 02-14-2006
    • Posts 54

    Re: Carriage Return In Text Box

    What do you mean by "Don't forget the & inside the quotes?" I cannot get this to work, but your message implies something else has to be added.

    Disreard the question. We figured it out.
    We needed an "&" in front of each encoded string.

    i.e. crlf="#xD;#xA;" needed "#xD;#xA;"

    quote:
    Originally posted by lxhiss

    Guys,

    Don't forget the & inside the quotes:

    Should read #
    btw fantastic solution.

    quote:
    Originally posted by whapakk

    If you are not that comfortable with script (like me!)
    You can use rules.

    create an xml file which consists of the following:

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

    then add a recieve data connection to your form using the xml file. now you can use the carriage return on your formula builders by pointing to those fields.

    ex. concat(field1, @crlf, field2)



  • 09-25-2007 01:12 AM In reply to

    Re: Carriage Return In Text Box

    Ah finally!

     

    Seriously been strugling with this issue for hours to make it work, i thought i had tried everything.

     

    This worked like a charm, thank you very much for this simple solution.

  • 12-30-2007 07:41 PM In reply to

    Re: Carriage Return In Text Box

    It looks like this doesn't work if you're using Forms Services and hosting the text box in a browser form. I'm unable to check the "Paragraph breaks" in the display. Does anyone have any other suggestions on how I can get this to work?

Page 1 of 3 (34 items) 1 2 3 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.