最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

validation - JavaScript to find TinyMCE rich text editor value is null or not - Stack Overflow

programmeradmin0浏览0评论

I use the TinyMCE textarea in one of my web applications.

  1. How to check the TinyMCE textarea's value is null or not using JavaScript?

document.getElementById("myeditorid").value didn't help me.

I use the TinyMCE textarea in one of my web applications.

  1. How to check the TinyMCE textarea's value is null or not using JavaScript?

document.getElementById("myeditorid").value didn't help me.

Share Improve this question edited Dec 17, 2010 at 15:38 Peter Mortensen 31.6k22 gold badges110 silver badges133 bronze badges asked Jan 23, 2010 at 4:29 ACPACP 35.3k101 gold badges233 silver badges373 bronze badges 0
Add a comment  | 

2 Answers 2

Reset to default 14

It's not a textarea any more, so the value property won't work.

This is how you get a reference to the editor, and the text from it:

var text = tinyMCE.get('myeditorid').getContent();
var text = tinyMCE.get('createSurvey:thankyouMsg_ifr').getContent();

here the predefined id was "thankyouMsg"..After the tinyMCe,its id changed to this.I try to get the value in this way but it is not working saying tinyMCE.get('createSurvey:thankyouMsg_ifr') is undefined

发布评论

评论列表(0)

  1. 暂无评论