macek/jquery-serialize-object

support serialization of elements whose names include "-"

alanning opened this issue · 1 comments

Currently form elements with names that begin with an underscore are ignored.

I already have a PR outstanding so I don't want to mess that up by including another commit but the fix for this is to change this line: https://github.com/macek/jquery-serialize-object/blob/master/jquery.serialize-object.js#L31

validate: /^[_a-z][a-z0-9_]*(?:\[(?:\d*|[a-z0-9_]+)\])*$/i,

... to this:

validate: /^[_a-z][a-z0-9_\-]*(?:\[(?:\d*|[a-z0-9_\-]+)\])*$/i,

Already covered by #6 so closing this one.

Including hyphens by default would match common css style naming convention.