Solved

Coldfusion using TinyMCE

Posted on 2014-11-08
6
147 Views
Last Modified: 2014-11-10
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?
0
Comment
Question by:Errol Farro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 29

Accepted Solution

by:
Pravin Asar earned 500 total points
ID: 40431248
<textarea id="elm1" name="contents" rows="30" cols="80" style="width:600px; height: 400px;"><cfoutput>#htmlcodeformat(qryDATA.contents)#</cfoutput>      </textarea>

See attached file for complete implementation example.

Once you figure out the tinyMCE editor options, it is really easy to customize the UI.
tinyMCE.html
0
 
LVL 25

Expert Comment

by:dgrafx
ID: 40431333
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 ...
0
 
LVL 29

Expert Comment

by:Pravin Asar
ID: 40431371
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.
0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 25

Expert Comment

by:dgrafx
ID: 40431405
It's not a matter of wrapping in cfoutput - it's a matter of using htmlEDITformat instead of htmlcodeformat !

just fyi ...
0
 
LVL 52

Expert Comment

by:_agx_
ID: 40433164
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
0
 
LVL 25

Expert Comment

by:dgrafx
ID: 40433392
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.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Coldfusion CFMESSAGEBOX Passing Variables 6 138
Sending Text Messages 1 63
Coldfusion get content of HTML table 8 220
Lucee & <cftransaction.... />  WITAF? 10 30
PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question