Skip to main content
Inspiring
November 14, 2007
Answered

populate cftextarea on cf8

  • November 14, 2007
  • 6 replies
  • 755 views
I am attempting to populate a cftextarea tag with html from a coldfusion object. I keep getting an error because of the html content in the database.

Any suggestions?
    This topic has been closed for replies.
    Correct answer Newsgroup_User
    have you tried it *without* jsstringformat()/urlencoded ()?

    ---
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

    6 replies

    SnazzoAuthor
    Inspiring
    November 16, 2007
    Not sure what I did, but using the value with no jsstringformat()/urlencoded () now works. Thank you for your help!
    Newsgroup_UserCorrect answer
    Inspiring
    November 16, 2007
    have you tried it *without* jsstringformat()/urlencoded ()?

    ---
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com
    SnazzoAuthor
    Inspiring
    November 15, 2007
    I tried using the value attribute with jsstringformat and with urlencoded value and they don't populate the editor with html. jsstringformat populates with the slashes still in the text.

    Any other ideas?
    Inspiring
    November 15, 2007
    try using
    <cftextarea ...
    value="#jsStringformat(noteOBJ.getNoteContent())#"></cftexarea>
    instead of
    <cftextarea ... >#jsStringformat(noteOBJ.getNoteContent())#</cftexarea>

    ---
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com
    SnazzoAuthor
    Inspiring
    November 15, 2007
    I suspect that is what is happening, so I did try to URLencode the data, and it populates, but it paces the URLencoded value into the editor, when I want it to show the original html inserted.
    Inspiring
    November 15, 2007
    If the content in the DB contains characters that would affect the generated html tag(s), then that is likely why it is not working.

    Try URLencoding the data before placing into the textarea and see if it works. If it does, then you will have to scrub the data before it is entered into the field each time; unless you are missing something particular for your CMS editor.