Skip to main content
Known Participant
January 13, 2010
質問

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.
  • 1097 ビュー

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

    このトピックへの返信は締め切られました。

    返信数 1

    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.

    123polis123作成者
    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>