> How do I access my form object inside of the error callback? > > $('#foo').ajaxForm({ > error: function(){ > // where's my $('#foo') object here? > } > });
One way is like this: $('form').ajaxForm({ beforeSerialize: function($form, opts) { opts.$form = $form; }, error: function() { // access form via this.$form this.$form.hide(); } });