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
Post a Comment