Expand my Community achievements bar.

Can I display rich text in a textfield?

Avatar

Level 1

I've created a form in LiveCycle Designer and there is a text field that is retrieving data from a table. The data in this field is entered from a ColdFusion form and its using the Rich Text Editor in the form. Because of this, the data that is displaying in the text field of the pdf looks like this:

<p>This is a comment.</p>

Is there any way for the text field to show the data with the proper formatting?  I've gone in to the field tab of the object and selected Rich Text for the Field Format but it doesn't help.

10 Replies

Avatar

Former Community Member

The data must be loaded into the field (because it is rich text). Here is an example of the command:

RichTest.value.exData.loadXML(field toload,1,1);

Paul

Avatar

Level 1

You've lost me. Where would I add this script? I tried putting it in the Binding name, but it didn't take it.

My field name called ConditionFound.

Thanks

Avatar

Former Community Member

You will need a field to hold the XHTML commands that you are retrieving ...lets call that field FieldA. No wwhen that field gets populated you want to load the data from FieldA into your ConditionFound Field......so on the appropriate event (lets try the calculate event) add this command:

ConditionFound.value.exData.loadXML(FieldA.rawValue,1,1);

Paul

Avatar

Level 1

Ok, I've added a new field which has a bind name called FieldA.

I click on the ConditionFound field  and open the script editor. I choose calculate and enter the following:

ConditionFound.value.exData.loadXML(FieldA.rawValue,1,1);

I save the form.

When I open the pdf from the link on my app, the FieldA field displays: <p>This is a test entry.</p> which it gets from the database.

The ConditionFound field is still blank.

Avatar

Former Community Member

Can you post you form and the data and I will have a look.

Paul

Avatar

Level 1

I'm attaching the pdf and the coldfusion file which populates the pdf with data from the database.

An example of the data that is stored in the comments column of my table is:

<p>This is a text entry. Please ignore.</p>

This is what gets displayed in my pdf. I'd like the pdf to show the proper formatting.

Avatar

Level 1

here's the coldfusion file which populates and displays the pdf.

Avatar

Former Community Member

The data that you load must be properly formatted .....I cannot run your ColdFusion code as I do not have access to your system, but I entered the data into the CommentsA field, saved out the data then put the data back into the Comments field. You had a typo in your command so I fixed it and moved it to the docReady event. I also put it on the button at the top. It now loads the xml just fine. I have included the modified sample.

Paul

Avatar

Level 1

I added the xml code into the value that is being passed and changed the language from FormCalc to javascript and its working now.  Thanks for all your help!

Avatar

Level 1

Hi Jeff,

I am having the same issue. Could you give me some more information on where you added the script exactly.

Thank you!