使用KindEditor和jquery.validate 验证数据同步

KindEditor的最新版本中,为了性能,取消了随时同步的功能,结果当使用jquery.validate来验证不为空时,必需要点两次,这个郁闷.javascript

研究半天,终于找到一个解决方案,直接上代码:java

if (typeof KindEditor !== "undefined" && KindEditor.instances) {
       $.each(KindEditor.instances, function() {
                this.sync();
        });
}

 把这段代码插入到jquery.validate的this.onsubmit下面(第56行),搞定!jquery

相关文章
相关标签/搜索