Skip to main content
Participating Frequently
January 15, 2011
Answered

How can I give users a simple html editor

  • January 15, 2011
  • 3 replies
  • 742 views

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?

    This topic has been closed for replies.
    Correct answer BKBK

    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>

    3 replies

    Participating Frequently
    January 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>

    Participating Frequently
    January 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)?

    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    January 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>

    Participating Frequently
    January 15, 2011

    I thought I tried that.

    Thanks a lot!!

    Inspiring
    January 15, 2011

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

    --

    Adam