Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 7
    didn't work for me so i made a small tweak: return {"name": this.name, "value": 'off' }
    – xeo
    Commented Feb 2, 2014 at 6:34
  • 1
    i love you. i have been struggling to find a solution to my problem and this came along thr google. Thank you
    – Justin
    Commented Mar 7, 2014 at 0:01
  • only works when you use serializeArray() not just serialize() Commented Apr 14, 2017 at 22:25
  • 1
    This worked better for me than the accepted answer, but 'this.checked' gave me the checkbox state instead of using 'this.value'. I also modified the jquery selector to ":checkbox" because I needed all of the checkboxes.
    – Paul
    Commented Jan 23, 2018 at 12:39
  • The jQuery docs say that using [type="checkbox"] is faster compared to :checkbox, see api.jquery.com/checkbox-selector
    – Peter T.
    Commented Oct 11, 2018 at 8:56