Skip to main content
Known Participant
January 13, 2010
Question

in a rich textarea like this i submit now but in CFML 9 , textarea text come to me formatted with ta

  • January 13, 2010
  • 1 reply
  • 1096 views

in a rich textarea like this i submit now but in CFML 9 , textarea text come to me formatted with tags ?

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    January 13, 2010

    It is so by design. By default, <cftextarea richText=true> is meant to return the HTML tags contained in displayed text.

    Known Participant
    January 13, 2010

    WHEN this rich textarea started to get supported (version) ? when enter contents of textarea, to a database table field what type of field to use, eg mysql...? so is required to enter/retrieve in tagged data and process accordingly, correct ?

    BKBK
    Community Expert
    Community Expert
    January 14, 2010

    The richText attribute was added to the cftextarea tag in Coldfusion 8. You could use htmlEdtFormat() to escape the tags before storing the string in the database, for example, like this

    <cfif isdefined("form.sbmt")>
    <cfset message = form.msg>
    <cfset msgForDatabase = htmlEditFormat(message)>

    <!--- code to store message in database --->
    </cfif>

    <cfform action="#cgi.SCRIPT_NAME#">
    <cftextarea name="msg" richText="true"></cftextarea>
    <cfinput type="submit" name="sbmt" value="send">
    </cfform>