Skip to content

How to convert Complex forms ? #118

Open
@wangfan0840

Description

@wangfan0840

hi!

<input name="user[email]" value="[email protected]">
 <input name="user[pets][]" type="checkbox" value="cat" checked>
 <input name="user[pets][][cat][]" type="checkbox" value="cat1" checked>
 <input name="user[pets][][cat][]" type="checkbox" value="cat2" checked>
 <input name="user[pets][]" type="checkbox" value="dog" checked>
 <input name="user[pets][]" type="checkbox" value="bird">

i want to got a json like:
{user: {email: "[email protected]", pets: [cat:["cat1","cat2"], "dog"]}}
but l got a json :
{ "user":{"email":"[email protected]","pets":["cat", "dog",null,{"cat":[null,null,"cat2"]} ]}
please tell me how to get the correct json string !
thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions