javascript - How to serialize form data into an object with nested properties -


given following inputs:

<input name="person[1]['first']" /> <input name="person[2]['first']" /> <input name="person[3]['first']" /> 

i want serialize object so:

person = {   1: {first:value},   2: {first:value},   3: {first:value} } 

is functionality available in jquery or javascript now? or have write function it?

you can use, when inside <form> tag:

$(formelement).serialize(); 

Comments

Popular posts from this blog

javascript - Create websocket without connecting -

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

android - Linear layout children not scrolling -