glenelkins Posted May 28, 2009 Share Posted May 28, 2009 hi im having trouble with this. here is some example code: <script type="text/javascript"> function get_textarea() { var area = document.getElementById ( 'testarea' ); var content = area.innerHTML; } </script> <form action="" method="post" onSubmit="get_textarea();"> <textarea name="testarea" id="testarea">CONTENT EXAMPLE TEXT</textarea> <input type="submit" value="Do" /> </form> Ok so the problem is it grabs the content of the textarea, but if i type something new into the area all it picks up is the old content that was placed there when the page loads. Even if i use var area = document.getElementsByName ( 'testarea' ); var content = area[0].value; still produces the same result Link to comment https://forums.phpfreaks.com/topic/159993-getting-textarea-content-with-javascript/ Share on other sites More sharing options...
glenelkins Posted May 28, 2009 Author Share Posted May 28, 2009 just looked at this again. I have tiny_mce used on the textareas. If i take tiny_mce off, it actually reads the content of the area correctly... any idea why it wont read it with tiny_mce ? Link to comment https://forums.phpfreaks.com/topic/159993-getting-textarea-content-with-javascript/#findComment-843929 Share on other sites More sharing options...
Ken2k7 Posted May 28, 2009 Share Posted May 28, 2009 TinyMCE must use some sort of frame for the textarea. Link to comment https://forums.phpfreaks.com/topic/159993-getting-textarea-content-with-javascript/#findComment-844145 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.