admin管理员组文章数量:1406031
Iam using Tinymce Editor for creating some content.I used textarea for getting tinymce editor.
For edting i have used this code
<textarea id="page_content_id" name="page_content"><?php echo $page_content;?></textarea>
So the saved value will be in tiny mce editor.If i add something to the editor how i can get the values in javascript using
document.getElementById("page_content_id").value
This wont give the new value.How i can get the entire value.
Iam using Tinymce Editor for creating some content.I used textarea for getting tinymce editor.
For edting i have used this code
<textarea id="page_content_id" name="page_content"><?php echo $page_content;?></textarea>
So the saved value will be in tiny mce editor.If i add something to the editor how i can get the values in javascript using
document.getElementById("page_content_id").value
This wont give the new value.How i can get the entire value.
Share Improve this question edited Dec 24, 2012 at 22:00 hakre 199k55 gold badges450 silver badges856 bronze badges asked Sep 21, 2010 at 6:45 Shinu ThomasShinu Thomas 5,31612 gold badges62 silver badges88 bronze badges2 Answers
Reset to default 6<textarea id="page_content_id" name="page_content" cols="50" rows="15">This is some content that will be editable with TinyMCE.</textarea>
<script language="javascript" type="text/javascript">
function ShowHTML(mceId)
{
alert( tinyMCE.get(mceId).getContent() );
}
</script>
<input type="button" value="ShowHTML" onclick="ShowHTML('page_content_id');">
or use .getHTML();
You can get the value in javascript by using the following
tinyMCE.activeEditor.getContent();
If you have multiple editors open at the same time, use
tinyMCE.get(idOfEditor).getContent();
本文标签: phpGetting textarea value in javascriptStack Overflow
版权声明:本文标题:php - Getting textarea value in javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744964480a2634859.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论