Skip to main content
Participant
January 21, 2009
Answered

get cftextarea value without submitting

  • January 21, 2009
  • 6 replies
  • 1894 views
Does anyone know how to extract the value of a cftextarea (html and all) without actually submitting the form?

**EDIT** Sorry I forgot to say it was a rich text feild
    This topic has been closed for replies.
    Correct answer winter_junkie
    Thank you both for taking the time to look at my problem. Dan, that article did help and it probably would be what I would have used had I not stumbled on this:

    ColdFusion.getElementValue(elementId [, formId, attributeName])

    I don't know why this was so hard to find, but it does exactly what I need. The documentation is here: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=JavaScriptFcns_04.html

    Hopefully now when someone goes searching they can find this article!

    6 replies

    December 7, 2012

    I know this is old, but I stumbled upon this thread and thought I'd add an answer that works for me running ColdFusion 10.

    ColdFusion.RichText.getEditorObject('your-textarea-id').GetHTML()

    Hope it helps someone!

    December 19, 2011

    A code snippet of how this was implemented would be most useful!

    winter_junkieAuthorCorrect answer
    Participant
    January 22, 2009
    Thank you both for taking the time to look at my problem. Dan, that article did help and it probably would be what I would have used had I not stumbled on this:

    ColdFusion.getElementValue(elementId [, formId, attributeName])

    I don't know why this was so hard to find, but it does exactly what I need. The documentation is here: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=JavaScriptFcns_04.html

    Hopefully now when someone goes searching they can find this article!
    Inspiring
    January 22, 2009
    <cftextarea richtext="yes"> implements FCKEditor WYSIWYG editor. check
    the docs on their website for instructions on how to get the text
    entered into the textarea.

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    Inspiring
    January 21, 2009
    Googling "javascript cftextarea" gave me this for the first offering.
    http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:56144

    Look promising?
    Inspiring
    January 21, 2009
    Not me. But if I wanted to try to figure it out for myself, I would google "javascript textarea value"

    By the way, if your js is weak, I recommend the book, Teach Yourself Javascript in 24 Hours by SAMS publishing. It's how I learned.
    Participant
    January 21, 2009
    Thank you for your reply. Sorry, I should have explained this a little better. I do know javascript pretty well, and have recently started implementing jquery to make things easier. The problem is, I found that the <cftextarea richtext="yes"> is output as an iframe within a iframe. When you edit the richtext box, it changes the inner iframe's body. I'm not sure how to get to that so I can pull it out, or even if that is what I need. There is no id tag.

    What I am assuming is that the there is some javascript function in the .js documents ColdFusion pulls in, that retrieves that data in order to submit it, but I want to submit it via ajax so I don't want to use an actual submit button. I have it working with a regular textbox, but when I add richtext="yes", it sends 'undefined' instead of what's currently in the textbox.

    Does this make any sense?