-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Nested attributes and optional splitting character #5
Conversation
with and without [].
…ionally added support to using closing [] in attribute names.
Thanks. This is just what I was after |
Thanks for the PR, I will take a look at this in the coming days!! I've been off for a while, so my apologies for taking too long. |
@pho3nixf1re thanks, works great. Too bad it hasn't been pulled in yet... |
One issue though, array's aren't serialized properly. E.g. <input type="number" name="root[items][0][quantity]" value="1">
<input type="number" name="root[items][1][quantity]" value="1"> Serializes as {
"root": {
"items": {
"0": {
"quantity": "1"
},
"1": {
"quantity": "1"
}
}
}
} Where i expected {
"root": {
"items": [
{
"quantity": "1"
},
{
"quantity": "1"
}
]
}
} |
Yes! You are correct, I'll see if I can't fix that by the end of the week. Surprised I didn't add a test for that. |
Suggested fix for #5
Fixed fix :-)
I know that this project is lacking In addition, as per #4 and #9 this plugin is a mere transformation of If you require an implementation which does all that, please see: https://github.com/macek/jquery-serialize-object |
Default splitting character is
[
See discussion: #4