问题:提交到asp.net后台获取不到值
解决方法:
var self;
KindEditor.ready(function (K) {
var editor1 = K.create('#content', {
cssPath: '../plugins/code/prettify.css',
uploadJson: 'http://www.cnblogs.com/Pub/Kindeditor/upload_json.ashx',
fileManagerJson: 'http://www.cnblogs.com/Pub/Kindeditor/file_manager_json.ashx',
allowFileManager: true,
afterCreate: function () {
self = this;
K.ctrl(document, 13, function () {
self.sync();
K('form[name=form1]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function () {
self.sync();
K('form[name=form1]')[0].submit();
});
}
});
prettyPrint();
});
$(document).ready(function () {
$("#form1").validate({
rules: {
txtTitle: "required",
txtDescription: "required",
txtKeywords: "required",
txtNames: "required",
content: "required"
},
success: function (label) {
label.addClass("success");
},
submitHandler: function (form) {
self.sync();
form.submit(); //注意这个地方不能用$(from).submit
}
});
$("#btnClose").click(function () {
window.location.href = "SysuserUI.aspx";
});
});
关键是self.sync();