我试图从对话框按钮的提交发送 ajax 调用,并且在 ajax 成功时我需要关闭与另一个对话框的对话框我在下面有一个对话框代码
$("#Forgot-password").dialog({
autoOpen: false,
heigth: 50,
width: 320,
modal: true,
buttons: {
"Submit": function () {
var bValid = true;
allFields.removeClass("ui-state-error");
bValid = bValid && checkLength(forgotUsername, "username", 3, 16)
if (bValid) {
$(".validateTips").text("Wait....");
$.ajax({
type: "POST",
url: url,
async:true,
data: { "REQUESTTYPE": 1, "USERNAME": forgotUsername.val() },
dataType: "json",
success: function(result) {
$(".validateTips").text("All form fields are required.");
$(this).dialog("close");
$("#dialog-forgot-message").dialog("open");
},
});
}
},
"Cancel": function () {
$(this).dialog("close");
$(".validateTips").text("All form fields are required.");
}
},
close: function () {
allFields.val("").removeClass("ui-state-error");
$(".validateTips").text("All form fields are required.");
}
});
所以,成功代码不起作用,任何人都可以帮助我,我在这里错了