1
我确认了提交值并获得成功提醒后,我创建了一个输入框,但我也取消了取消按钮的成功?Ajax在这两种情况下运行
swal({
title: " Asking price for " + askData[0] + "?",
text: "If you are sure press OK or edit this text",
type: "input",
inputType: "text",
inputValue: "Hello " + askData[1] + ", I am interested in buying your " + askData[0] + " of Variety :" + askData[3] + ". Please update the Price!",
showCancelButton: true,
closeOnConfirm: false,
showLoaderOnConfirm: true
}, function (inputValue) {
if (inputValue === "") {
swal.showInputError("Please write something !");
return false;
}
$.ajax({
url: urlEnq,
type: "GET"
});
$.ajax({
url: 'saveUserMessage',
type: "POST",
data: {
fieldUserId: fieldUserId,
filedUserCompanyId: filedUserCompanyId,
message: inputValue
},
})
.done(function (data) {
swal("Done!", "Your message has been successfully sent.", "success");
})
.error(function (data) {
swal.showInputError("Please write something !");
});
什么是'inputValue'可变的,当您单击取消的价值? –
inputValue用于输入值字段,一个文本框。 –
是的,我们知道变量的实际值是多少?你正在做一个如果在该变量,以决定是否需要做阿贾克斯调用 –