Concat a multiline textbox with newline value - InfoPath Dev
in

InfoPath Dev

Concat a multiline textbox with newline value

Last post 07-15-2013 10:14 AM by brunettej. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-12-2013 12:38 PM

    Concat a multiline textbox with newline value

    Hello all,

    I need some help.  I am using Infopath 2010 and I am looking for a way keep adding values to a textbox once a butoon is clicked.  I have a equipment request form that does the following:

    user selects the following:

    1. (radio buttons) catagory

    2. (dropdowl list) department

    3. (dropdown list) description

    Once all 3 of the above are selected additional information such as part number, cost, amount on hand are displayed in (readonly) textboxes.  Ok. heres where I have trouble.  I now want the user, if happy, click the "add to cart button" where I would concat() certian objects and set a value of another multiline textbox such as:

    1. Catagory selected 2. Description 3. Cost <-"value from read only textbox"

     This works fine but I want to allow another selection to be made possible and add that new selection to the same textbox but with a newline return so now it would look like this:

    <new selection> 1. Catagory selected 2. Description 3. Cost <-"value from read only textbox"

    <old selection> 1. Catagory selected 2. Description 3. Cost <-"value from read only textbox"

    and keep going unyill they selected everything.

     This is an easy day if I was allowed to use C# but I can't use code behind due to my work policies. 

    C#: tbxCart += "\n" + ddlDescription.selectedValue.tostring() + " " + tbxCost.text //might be wrong but the concept is there

    Is there any way to do this without the use of a repeating section or repeating table.  I know its not a correct way to do a "shopping cart" but it works for my application. 

    Thnak you all very much.

  • 07-13-2013 12:59 PM In reply to

    Re: Concat a multiline textbox with newline value

    I responded to a post about a month ago. You can concat a newline to your field if you use another field that is set to the newline. You can test this out by adding a multiline field to your form and entering a line into it. Add a button that concatenates this field to your others. How to set by default? Just file->save the XML and add a data connection to include the XML for the newline field. Then your concat can use that instead of a field from your main data source.

    So that should work, but you may want to rethink what you are doing.

    <rant>

    Sounds like you are not taking advantage of the structured data output that InfoPath is capable of.

    In other words, the output format should be XML. The process that consumes it should change to handle that. That's easier than hacking InfoPath to spit out something that uses old-school newlines to separate records. Why cripple the capabilities of InfoPath by downshifting the output?

    </rant>

    Good luck!

    P

    Patrick Halstead
    Project Manager at Qdabra
  • 07-15-2013 10:14 AM In reply to

    Re: Concat a multiline textbox with newline value

    Patrick, Thanks for the info. I know this isn't the best way to do what I am doing but works for what my works need. I am still messing with other options. Anyways thanks for the reply, greatly appreciated.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.