$("#form1").validate({ rules: { ctl00$ContentPlaceHolder1$txtShopName: { remote: { type: "post", url: "/Tools/submit_ajax.ashx?action=validate_shopname", data: { name: function () { return $("#ContentPlaceHolder1_txtShopName").val(); } }, dataType: "html", dataFilter: function (data, type) { if (data == "true") { return false; } else { return true; } } } } }, messages: { ctl00$ContentPlaceHolder1$txtShopName: { remote: "该店铺名已存在!" } }, errorElement: "span", success: function (label) { label.text(" ").addClass("success"); } //正确时的样式 });