Tag : separate lines

InfoPath – Adding special characters to text boxes

To separate comments or data within a text field you can use a line feed and carriage return. You can enter these special characters into the field directly but I have found that a data connection to an xml file that defines these values makes it simpler to use and understand

Create an XML file

The first step is to create an xml file that contains the values needed. Create a file using Notepad called, for example, ‘characters.xml’ that has the following contents (You can add more fields if you need to – just stick to the format):

<?xml version=”1.0″ encoding=”UTF-8″?>

<characters

    cr=”&#xD;”

    lf=”&#xA;”

    crlf=”&#xD;&#xA;”

/>

Add a data connection to the file

Add a data connection to this xml file and set ‘Automatically retrieve data when form is opened’ to true

103-2

Use the fields in the file

Reference the fields within the xml file as you would any other field by using the ‘Insert Field or Group …’ button in your formulas

103-1

The concat() command above will produce the following result:

Hello

World