gpt4 book ai didi

javascript - Mootools 成功、失败和提交代码

转载 作者:行者123 更新时间:2023-11-30 05:44:49 25 4
gpt4 key购买 nike

Mootools 验证是否有类似的过程

成功失败ajaxSubmitFile

 $("#rems").validationEngine({
ajaxSubmit: true,
ajaxSubmitFile: "database/agentpanel/reminder/makerem.php",
success : function() {
$.get("database/agentpanel/reminder/loadrem.php", function(html) {
$("#rem-scroll").html(html);
alert("Reminder Set");
$('#rems').find("input[type=text], textarea").val("");
$('#rem_confirm').attr('checked', false);
});
},
failure : function() { alert("Fill in all the fields with Red Marks"); }
});

我希望能够在不转到下一页的情况下发送表单,并在成功失败 时运行脚本。

最佳答案

您可以将事件函数添加到 Mootools Form Request

试试这个:

new Form.Request(myForm, myResult, {      
onSend: function () { // function to run on send
alert('Will send now!');
},
onFailure: function (){//function to run if failure (fires after onComplete)
alert('oops...!');
},
onComplete: function () {//function to run on send complete
alert('Submited!');
},
onSuccess: function () {//function to run on success
alert('Success!');
},
requestOptions: { //etc...

演示 here

值得一读:

关于javascript - Mootools 成功、失败和提交代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18602259/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com