js 判断富文本编辑器是否为空
js 判断富文本编辑器是否为空。
不能再去判断<textarea>是否为为空!
<textarea id="ct" name="content" ><?php echo html_entity_decode($currArticle['content']);?></textarea>
var content = ue.getContent(); content==''
具体代码片段:
var ue = UE.getEditor('ct',{initialFrameHeight:500}); function add_check() { //判断表单数据是否为空 var content = ue.getContent(); if($("#title").val()==''||$("#typeid").val()==''||content=='') { alert("提交数据不完整,不能为空"); return false; } return true; }