Mike Alsup wrote:
>> Is it possible to have the Forms plugin $.formToArray include the
>> clicked submit element (name/value pair) -- as the W3C standard does.
>> Currently it seems to be ignored, even when semantic is passed as true.
>>     
>
> Brice,
>
> You need to use the ajaxForm method for that support, you can't do it
> with ajaxSubmit.  ajaxSubmit is invoked in response to the user
> submitting the form, at which point it's too late to determine how
> they did it.  ajaxForm adds event listeners to all the submit elements
> so that it can capture that info.
Mike,  Thanks for pointing that out. Makes sense. I've been hijacking 
the $.formToArray() method to send to a $.load() call -- mainly because 
I'd like to populate a div with the output.

e.g.

$(e).load(form.formToArray(), callback);

Perhaps I can do this with $.ajaxForm() & writing the responseText to 
the element via; $(e).html(responseText) in the callback? Or maybe I 
could just return false from the preSubmit callback & execute the load 
from there?

e.g.

function preSubmit(data, form, options) {
    $(e).load(data, callback);
    return false;
}

What would the masa do? ;)

~ Brice

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to