How to get form Element back in success from AjaxForm?

232 views Asked by At

I use AjaxForm to work with forms.

In the "success" I need to get back one of my form fields. The sucess sunction has this info on authors page:

success Callback function to be invoked after the form has been submitted. If a 'success' callback function is provided it is invoked after the response has been returned from the server. It is passed the following arguments:

    1.) responseText or responseXML value (depending on the value of the dataType option).
    2.) statusText
    3.) xhr (or the jQuery-wrapped form element if using jQuery < 1.4)
    4.) jQuery-wrapped form element (or undefined if using jQuery < 1.4)

Now the last is $form, that is said to have all form elements inside. How do I get one particular form element in a variable, so I can use it? I don't understand what means jquery wrapped form element.

The plugin I use is this:

http://malsup.com/jquery/form/#options-object

1

There are 1 answers

0
shenyan On

The third argument to the complete callback function should contain a reference to the element:

{
   ...
   complete: function(xhr, msg, el) { ... }
   ...
}