Skip to content
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

error when traversing back a nested level namespace #39

Open
ghost opened this issue Oct 29, 2012 · 0 comments
Open

error when traversing back a nested level namespace #39

ghost opened this issue Oct 29, 2012 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 29, 2012

this will fail if you traverse back a level in the array:

 <form id="tests">
     <input name="something[something][title]" value="test"/>
     <textarea name="something[description]">Test</textarea>
 </form>

$('#tests').toObject();

Result:

Uncaught TypeError: Object # has no method 'push'

and to reorder so not traversing back results in an unexpected object:

<form id="tests">
    <textarea name="something[description]">Test</textarea>
    <input name="something[something][title]" value="test"/>
</form>

$('#tests').toObject();

Result:

something:
    0: "Test"
    something:
        title: "test"

Expected result for both cases:

something:
    description: "Test"
    something:
        title: "test"

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

0 participants