I have an object for example in the form:
{
"test": {
"valid": false,
"children": {
"a": {
"valid": false,
"children": {
"1": {
"valid": false,
"children": {
"c": {
"valid": false
},
"d": {
"valid": false
}
}
}
...
}
},
"b": {
"valid": false
},
// ...
}
}
}
I also have an input
named name="test[a][1][c]"
or name="test[b]"
. I need to get the get the valid
property from the object with the same name of the input. Unfortunately I have no idea how to solve this problem.
My first problem is that I do not know how to divide the input name to a tree. Thank you for help.
edit:
How get universal value 'valid' from the name of INPUT?
I need from the name of INPUT create: json ['test']['children']['a']['children']['1']['children']['c']['valid']