I have a page that is part of CRUD on which I can edit my data and send it to Update action of my php app. Basically, it is a HTML form with input fields. On this page I'm trying to implement some kind of drag-n-drop list arrangement via jQuery plugin. After sorting elements I create an array by js script that holds my hierarchy and it looks like this:
[
{
"id": 21,
"name": "John"
},
[
{
"id": 25,
"name": "Bill"
},
{
"id": 20,
"name": "Ann"
}
],
{
"id": 18,
"name": "Sally"
},
{
"id": 24,
"name": "Tom"
}
]
Now, how can I pass this array from javascript to my update action via POST with the rest of my form so I can store it in DB in a proper JSON format?