Skip to main content
Participating Frequently
June 17, 2008
Question

Getting CFTEXTAREA value

  • June 17, 2008
  • 2 replies
  • 367 views
When I use:

<cftextarea name="stuff" id="stuff" html="yes" enabled="Yes" visible="Yes" richtext="No" cols="30" rows="5"></cftextarea>

I can bind a div called content to stuff with the following:

document.getElementById('content').innerHTML=document.getElementById('stuff').value;

As soon as I turn richtext="yes" it breaks.

Does anyone know of a simple solution to this?
This topic has been closed for replies.

2 replies

Inspiring
June 19, 2008
Try this.

<cftextarea name="stuff" id="stuff2" html="yes" enabled="Yes" visible="Yes" richtext="No" cols="30" rows="5"></cftextarea>

I can bind a div called content to stuff with the following:

document.getElementById('content').innerHTML=document.getElementById('stuff2').value;

By changing the id it makes it easier. I had a similar problem with my code. It took me several days to figure it out. Hopefully it works. But make sure to assign the value passed from the id=stuff2 to stuff.


Inspiring
June 18, 2008
the solution is not simple, since when you turn richtext on, FCKEditor
takes over your textarea. check FCKEditor documentation on their website
how to access the value (text) of the textarea.

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