ajaxForm错误回调内的表单对象 [英] form object inside of ajaxForm error callback

查看:114
本文介绍了ajaxForm错误回调内的表单对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在ajaxForm的错误方法内部访问我的表单对象:

I'm trying to access my form object inside of ajaxForm's error method:

$('#foo').ajaxForm({
  error: function(){
    // where's my $('#foo') object?
  }
});

错误可以包含3个参数,但它们都不是表单对象,这也返回url,但同样没有表单.

error can take 3 params, but none of them are the form object, also this returns the url, but again no form.

有什么建议吗?

推荐答案

棘手,为什么不使用:

var myForm = $("#foo");

myForm.ajaxForm({
 error: function(){
  myForm.//whatever
 }
});

如果有另一种方式,我很想认识自己.

If there is another way, I'd love to know myself.

这篇关于ajaxForm错误回调内的表单对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆