Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

jQuery plugin to serialize form elements into an object

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 README
Octocat-spinner-32 jquery.serializeObject.js
README
$.fn.serializeObject makes an object out of form elements inside of the specified item.

Example: 
<div id="test">
    <input name="text1" value="txt-one" />
    <input type="checkbox" name="top[child][]" value="1" checked="checked" />
    <input type="checkbox" name="top[child][]" value="2" checked="checked" />
    <input type="checkbox" name="top[child][]" value="3" checked="checked" />
    
    <select name="another[select]">
        <option value="opt"></option>
    </select>
</div>

$( '#test' ).serializeObject();

Returns

{ text1: "txt-one",
  top: {
    child: [ "1", "2", "3" ]
  },
  another: {
    select: "opt"
  }
}
Something went wrong with that request. Please try again.