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

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -