Link to home
Start Free TrialLog in
Avatar of Errol Farro
Errol FarroFlag for Aruba

asked on

Coldfusion using TinyMCE

I am developing a lightweight editor using TinyMCE.

Once the user has entered the text and images in in TinyMCE, I capture that information using #form.post# and store it in a table.

The #form.post# contains HTML tags such as
<p>Hello&nbsp;</p> <p>My name is John</p> <p><span style="text-decoration: underline;"><em>I like Coldfusion/em></span></p>

My question is, how do I open TinyMCE and pass the stored table information (#form.post#) back to TinyMCE?
ASKER CERTIFIED SOLUTION
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello
I would disagree with the htmlcodeformat answer!

You should use
#htmlEDITformat(trim(xxx))#
xxx is simply your variable name of course - it's your form.post from your example

good luck ...
of course you need wrap with cfoutput

cfoutput>#htmlcodeformat(qryDATA.contents)#</cfoutput>

I have posted complete example, which shows how to
1. Customize tinyMCE
2. Populate tinyMCE textarea
3. Read textarea and update/add record

Hope this example helps to understand complete lifecycle.
It's not a matter of wrapping in cfoutput - it's a matter of using htmlEDITformat instead of htmlcodeformat !

just fyi ...
With all due respect, the correct answer is HTMLEditFormat as dgrafx suggested.

Though the functions may seem similar, they serve different purposes. HTMLCodeFormat is designed to display code. Like when you use the "Code" button on the EE toolbar. It encloses the content in PRE tags, so you see it as literal HTML code like this:

      My name is <strong>John</strong>

Open in new window


HTMLEditFormat is designed for rendering html code, which is what rich text editor does. So instead of html code, you would see:

      My name is John

So the correct function is HTMLEditFormat  - not HTMLCodeFormat
Yes - what _agx_ said is 100% accurate.
Check out his credentials if you doubt his opinion. He is the expert that we experts rely on when we don't know or are having trouble with a difficult issue.

htmlcodeformat may appear to work at first glance, but upon closer inspection you'll see that it does not.

When I saw that the incorrect answer had been chosen by the question asker I was expecting that Pravin Asar (who posted the accepted incorrect answer) would have by then realized his error and spoken up.
The main purpose of Experts-Exchange is to provide accurate information - not to just receive points - especially for incorrect answers.

And I mean no disrespect to anyone - I just needed to post for the above reason.