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?
ColdFusion Language

Avatar of undefined
Last Comment
dgrafx
ASKER CERTIFIED SOLUTION
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of dgrafx
dgrafx
Flag of United States of America image

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 ...
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

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.
Avatar of dgrafx
dgrafx
Flag of United States of America image

It's not a matter of wrapping in cfoutput - it's a matter of using htmlEDITformat instead of htmlcodeformat !

just fyi ...
Avatar of _agx_
_agx_
Flag of United States of America image

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
Avatar of dgrafx
dgrafx
Flag of United States of America image

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.
ColdFusion Language
ColdFusion Language

ColdFusion is a server-side rapid application development platform originally created by Allaire and now sold by Adobe, implementing the dynamic general purpose CFML programming language. The term ColdFusion is sometimes colloquially used to refer to the CFML language (Cold Fusion Markup Language), but can also include discussions of the server software implementation. ColdFusion runs using a customised version of Apache Tomcat. Earlier versions are bundled with JRun.

11K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo