I haven\'t found a concrete answer as to whether this is possible, but it seems like it should be...
I would like to serialize all the input elements contained in a
Try this, to get all.
$('#divID *').serialize()
For serializing the contents of the div with a button, this will be the more efficient way as it doesn't traverse through the entire dom.
$(this).closest('div').find("input,select,textarea").serialize();
make sure to attach this with the button event and make sure to include event.preventdefault with the button so that it does not submit the primary form if the div is inside it.
this also works with
$('div :input').serializeArray()
:)
you need to serialize all the inputs inside your container, not the actual container itself. so:
$('div :input').serialize()