Mootools验证是否有类似的
过程 Success
,Failure
和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"); }
});
我希望能够在不转到下一页的情况下发送表单,还可以在success
和failure
上运行脚本。
答案 0 :(得分:1)
您可以将事件功能添加到Mootools 表单请求。
试试这个:
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...
值得一读: