$(function(){ UE.getEditor('content').addListener('contentchange',function(){ this.sync(); //1.2.4+以后可以直接给textarea的id名字就行了 $('textarea').valid(); }); var validator = $("#myform").submit(function() { UE.getEditor('content').sync(); }).validate({ ignore: "", rules: { title: "required", content: "required" }, errorPlacement: function(label, element) { label.insertAfter(element.is("textarea") ? element.next() : element); } }); validator.focusInvalid = function() { if( this.settings.focusInvalid ) { try { var toFocus = $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []); if (toFocus.is("textarea")) { UE.getEditor('content').focus() } else { toFocus.filter(":visible").focus(); } } catch(e) { } } } })

### Ueditor在jquery validation下的验证

其他内容
编辑器