That's cool. I was just under the impression from the spec that if the
form contains only a single submit button, it is by default considered
successful:
"If a form contains more than one submit button, only the activated
submit button is successful."
But, I suppose it would be too much to figure that kind of stuff out
in the core serialize. Better to use the form pugin.
thanks for the reply.
--Karl
On Oct 25, 6:47 pm, "John Resig" <[EMAIL PROTECTED]> wrote:
> Correct, they're considered successful - but only if they're being clicked.
> Since we currently don't bind a click handler to determine if every submit
> button is being clicked we leave that to a plugin to handle.
>
> --John
>
> On Sat, Oct 25, 2008 at 4:53 PM, Karl Swedberg <[EMAIL PROTECTED]>wrote:
>
> > Hey guys,
> > I just noticed that the serialize and serializeArray methods aren't
> > including inputs with type="submit" . Is this intentional?
>
> > in jquery.js:
> > * $Date: 2008-10-18 18:22:08 -0400 (Sat, 18 Oct 2008) $ * $Rev: 5891 $
>
> > lines 2484-2505:
>
> > serialize: function() {
> > return jQuery.param(this.serializeArray());
> > },
> > serializeArray: function() {
> > return this.map(function(){
> > return this.elements ? jQuery.makeArray(this.elements) : this;
> > })
> > .filter(function(){
> > return this.name && !this.disabled &&
> > (this.checked || /select|textarea/i.test(this.nodeName) ||
> > */text|hidden|password/i.test(this.type)*);
> > })
> > .map(function(i, elem){
> > var val = jQuery(this).val();
> > return val == null ? null :
> > val.constructor == Array ?
> > jQuery.map( val, function(val, i){
> > return {name: elem.name, value: val};
> > }) :
> > {name: elem.name, value: val};
> > }).get();
> > }
>
> > Submit inputs are considered successful controls[1], so I was a little
> > surprised that they aren't included. Am I missing something?
>
> > [1]http://www.w3.org/TR/html401/interact/forms.html#successful-controls
>
> > --Karl
>
> > ____________
> > Karl Swedberg
> >www.englishrules.com
> >www.learningjquery.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---