繁体   English   中英

CKEDITOR 无法将验证添加到输入

[英]CKEDITOR Not able to add validate to input

我无法向此 CKEDITOR ccontrol 添加验证? 我有这个<input name="editor1" class="required" id="editor1"></input>然后我CKEDITOR.instances.editor1.updateElement(); 但它不会向此控件添加所需的标签,任何帮助都会很棒。

工作样本http://jsfiddle.net/tjmcdevitt/yhze8m1j/1/

js代码

$('#add-job').validate({
    ignore: [],         
    rules: {
                editor1: {
                    required: function() 
                    {
                    CKEDITOR.instances.editor1.updateElement();
                    }
                    }
                },
                messages: {
                Job_Title: "Required",
                Job_Location: "Required",
                jobid: "Required",
                Job_Cat: "Required",
                editor1: "Required"
                },
                /* use below section if required to place the error*/
                errorPlacement: function(error, element) 
                {
                    if (element.attr("name") == "editor1") 
                   {
                    error.insertBefore("textarea#editor1");
                    } else {
                    error.insertBefore(element);
                    }
                }
            });
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM