Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can I give users a simple html editor

Explorer ,
Jan 15, 2011 Jan 15, 2011

I want my users to be able to edit an SQL text field and give them a wysiwyg editor - then have it displayed properly in a browser - just like the area I'm typing in to make this post.

I noticed there was a rich text option in a cftextarea tag, but I need html.

Can someone tell me how this site works or an alternative that I can use?

671
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 15, 2011 Jan 15, 2011

RichieWhite wrote:

I believe the rich text editor with cftextarea will work for me.

Does anyone know how to display rich text content in a browser (and it look like it does in the control)?

From the documentation on richText:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<!--- Display the text if the form has been submitted with text. --->
<cfif isdefined("form.richtext01") AND (form.richtext01 NEQ "")>
    <cfoutput>#form.richtext01#</cfoutput><br />
</cfif>

<!--- A form with a

...
Translate
LEGEND ,
Jan 15, 2011 Jan 15, 2011

Looking @ the mark-up of this page, it looks like they're using TinyMCE as the text editor.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 15, 2011 Jan 15, 2011

I believe the rich text editor with cftextarea will work for me.

Does anyone know how to display rich text content in a browser (and it look like it does in the control)?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2011 Jan 15, 2011

RichieWhite wrote:

I believe the rich text editor with cftextarea will work for me.

Does anyone know how to display rich text content in a browser (and it look like it does in the control)?

From the documentation on richText:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<!--- Display the text if the form has been submitted with text. --->
<cfif isdefined("form.richtext01") AND (form.richtext01 NEQ "")>
    <cfoutput>#form.richtext01#</cfoutput><br />
</cfif>

<!--- A form with a basic rich text editor and a submit button. --->
<cfform name="form01">
    <cftextarea richtext="true" name="richtext01" basepath="/CFIDE/scripts/ajax/FCKEditor" />
    <cfinput type="submit" value="Enter" name="submit01">
</cfform>
</body>
</html>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 15, 2011 Jan 15, 2011
LATEST

I thought I tried that.

Thanks a lot!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 15, 2011 Jan 15, 2011

The richtext option creates an HTML editor.  So once you've saved that to the database, just output to the browser like any other text:

<cfoutput query="yourQry">

     #yourBigTextField#

</cfoutput>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources