Open ghost opened 12 years ago
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();
something: 0: "Test" something: title: "test"
Expected result for both cases:
something: description: "Test" something: title: "test"
this will fail if you traverse back a level in the array:
Result:
and to reorder so not traversing back results in an unexpected object:
Result:
Expected result for both cases: