How to serialize as an array of objects from multiple fields in jQuery?

Posted by teebot.be on Stack Overflow See other posts from Stack Overflow or by teebot.be
Published on 2010-03-30T09:57:02Z Indexed on 2010/03/30 10:13 UTC
Read the original article Hit count: 290

Filed under:
|
|

Hi,

I'm using jQuery to dynamically add new divs containing a few fields. I'm adding new tunes in this example of output:

<div id="uploadedTunes">
   <div class="tune">
     Title:<input type="text" name="Title">
     Length:<input type="text" name="Length"> 
   </div>
   <div class="tune">
     Title:<input type="text" name="Title">
     Length:<input type="text" name="Length"> 
   </div>
</div>

Is there a way to serialize only the fields in the div uploadedTunes (and not the whole form) ? And how do I serialize this so I have an array like this:

uploadedTunes{ tune { Title="highway to hell", Length="03:01" } }

Thank you for your help or clues!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-selectors