Hello -

This is done not for a technical reason but due to the fact that
submit buttons are only sent to the server if they're clicked by the
user. I highly recommend the form plugin for handling this case as
it'll bind a click handler and watch to see which submit button is
clicked and serialize it appropriately.

I have updated the wiki page to note this:
http://docs.jquery.com/Ajax/serialize

--John



On Mon, Dec 14, 2009 at 3:00 PM, batfastad <batfas...@yahoo.co.uk> wrote:
> Hi everyone
>
> I've been testing some old sites to start using some jQuery .post
> goodness and I came across an oddity
> I decided to serialize() my form data so I don't have to specify the
> exact data I want posted on loads of different pages.
>
> However I notice the value of any submit buttons isn't serialized.
> Took me many hours to figure that out today.
> I have a few scripts which branch based on which submit buttons are
> pressed - it's perfectly acceptable to have more than one and even
> with different name attributes.
>
> I'm guessing it's probably a technical reason as to why submit buttons
> aren't serialized as it's quite different from the behaviour of
> regular non-JS HTML forms.
>
> Is this on any lists of planned changes for the dev gurus?
> Is it worth me filing something in the bugs system?
>
> One suggestion though... it's probably worth mentioning this on the
> wiki page for the serialize function as it's definitely not obvious
> that's what happens.
> I will create an account and do this if anyone agrees... anything to
> prevent others from wasting their time!
>
> Cheers, B
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "jQuery Development" group.
> To post to this group, send email to jquery-...@googlegroups.com.
> To unsubscribe from this group, send email to 
> jquery-dev+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/jquery-dev?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-...@googlegroups.com.
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en.


Reply via email to