support serialization of elements whose names include "-"
alanning opened this issue · 1 comments
alanning commented
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,