baidu_27533675 2015-11-23 09:16 采纳率: 0%
浏览 2333

使用kindedit在线编辑器后怎么判断文本域不能为空

HTML页面代码

JS代码
KindEditor.ready(function(K) {
window.editor = K.create('#editor_id');

                var options = {
                        cssPath : '/css/index.css',
                        filterMode : true
                        };
                        var editor = K.create('textarea[name="con"]', options);
                        // 取得HTML内容
                        html = editor.html();


                        // 同步数据后可以直接取得textarea的value
                        editor.sync();
                        html = document.getElementById('editor_id').value; // 原生API

                        html = K('#editor_id').val(); // KindEditor Node API
                        html = $('#editor_id').val(); // jQuery

                        // 关闭过滤模式,保留所有标签
                        KindEditor.options.filterMode = false;

                        KindEditor.ready(function(K) {
                               K.create('#editor_id');

                        });


        });

编辑器已经发布到服务器中了,该配置的都配置好了,那我应该怎么去判断现在的文本域不能为空?

在普通文本域我之前用的JS现在失效了
function form(){

    if(document.f.tit.value.length==0){
        alert("标题不能为空!");
        document.f.tit.focus();
        return false;
    }
    if(document.f.con.value.length==0){
        alert("内容不能为空!");
        document.f.con.focus();
        return false;
    }

    }



    现在就是不知道怎么去改JS判断是否为空了
  • 写回答

3条回答 默认 最新

  • baidu_27533675 2015-11-23 09:26
    关注

    这是HTML代码

    评论

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型