使用 Spry 验证的 ajaxForm
我正在尝试将 spry 验证与 ajaxForm 一起使用。问题是我不认为我在 beforeSubmit 时强制进行 spry 验证是找到表单。我没有收到任何错误,似乎 beforeSubmit 没有触发,因为它找不到表单“form1”
$("#form1").ajaxForm({
url: "processPhoneEdit.php",
beforeSubmit: function(){
if (Spry) { // checks if Spry is used in your page
var r = Spry.Widget.Form.validate(form1); // validates the form
if (r)
alert("testing");
return (r);
}
},
success: alert("success"),
complete: alert("complete")
});
I am trying to use spry validation with ajaxForm. The problem is I don't think my forcing spry validation at time of beforeSubmit is finding the form. I'm not getting any errors, seems like beforeSubmit isn't firing because it can't find the form, "form1"
$("#form1").ajaxForm({
url: "processPhoneEdit.php",
beforeSubmit: function(){
if (Spry) { // checks if Spry is used in your page
var r = Spry.Widget.Form.validate(form1); // validates the form
if (r)
alert("testing");
return (r);
}
},
success: alert("success"),
complete: alert("complete")
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不是一个程序员,但这是我的解决方案:
I'm not much of a programmer, but this was my solution:
试试这个..
Try this..