判断kindeditor 是否为空,如果为空不提交

        KindEditor.ready(function (K) {
            var editor = K.create('#description', {
                //上传管理
                uploadJson: '/kindeditor/asp.net/upload_json.ashx',
                //文件管理
                fileManagerJson: '/kindeditor/asp.net/file_manager_json.ashx',
                allowFileManager: true,
                //设置编辑器创建后执行的回调函数
                afterCreate: function () {
                    //alert("after");
                    $("#dailyRecordCreateSub").click(function () {
                        var conCon = $(".ke-content").html();
                        if (editor.isEmpty()) {
                            alert("is null");
                        }
                        else {
                            alert(editor.html());
                        }
                        return false;
                    })



                    var self = this;
                    K.ctrl(document, 13, function () {
                        self.sync();
                        K('form[name=example]')[0].submit();
                    });
                    K.ctrl(self.edit.doc, 13, function () {
                        self.sync();
                        K('form[name=example]')[0].submit();
                    });
                },
                //上传文件后执行的回调函数,获取上传图片的路径
                afterUpload: function (url) {
                    //alert(url);
                },
                //编辑器高度
                width: '786px',
                //编辑器宽度
                height: '300px;',
                //配置编辑器的工具栏
                items: [
                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                'insertunorderedlist', '|', 'emoticons', 'image', 'link', 'unlink'
                ]
            });
            prettyPrint();
        });


<div class="editor-label storeDailyDesc">
                <div class="storeDailyDescLeft">描述:</div>             
                <div class="storeDailyDescRight">
                @Html.TextAreaFor(model => model.description)      
                @Html.ValidationMessageFor(model => model.description)
                </div>
            </div>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值