成功、失败和提交的Mootools代码
Mootools code for success, failure and submit
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
上运行脚本。
您可以将事件函数添加到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...
此处演示
值得一读:
- 表单请求上的Mootools博客
- Mootools文档(Form.Request)
相关文章:
- 从桌面读取python文件时高亮显示代码
- 如何将函数包装在函数中以避免代码重复
- 通过单击表单中的按钮,在代码生成中使用javascript生成字母数字代码
- 货币代码为欧元-金额的格式不应包含小数
- Regex代码只允许一个空格
- 如何将屏幕分辨率乘以 80%,然后在代码中使用
- 从var向代码隐藏函数传递值
- 如何动态插入jquery代码
- 如何在php变量中嵌入JQuery代码
- 代码不会验证
- 如何从rails中的代码中删除新行( )
- 如何将我自己的验证代码添加到MooTools的lightface表单中
- 如何使用mootools确定损坏图像上的错误代码
- 成功、失败和提交的Mootools代码
- 将jQuery代码转换为Mootools
- 单元测试Mootools代码的最佳解决方案
- javascript Issue mootools drag.cart以下代码有什么问题
- 在mootools中转换jquery代码
- MooTools代码中出现意外语法错误
- 为什么我的mootools幻灯片实例阻止代码和幻灯片被执行?