Skip to content

support serialization of elements whose names include "-" #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alanning opened this issue Sep 14, 2014 · 1 comment
Closed

support serialization of elements whose names include "-" #32

alanning opened this issue Sep 14, 2014 · 1 comment

Comments

@alanning
Copy link
Contributor

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,

@alanning
Copy link
Contributor Author

Already covered by #6 so closing this one.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant