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

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

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

StringGrid issue in Delphi XE8 firemonkey mobile app -