Hi All,
I have to populate two drop-downs according to the data contained in a JSON file.
The first drop-down should contain the organisation name. The second drop-down should contain the name of those sites which belong to the organisation selected using the first drop-down.
I have been banging my head against it for the last two days. Any help is very much appreciated.
This is my JSON:
Code:
{
"organization": [
{
"id": 1,
"name" : "ORG 1",
"site": [
{
"id":1,
"name":"site01"
},
{
"id":2,
"name":"site02"
},
{
"id":3,
"name":"site03"
},
{
"id":4,
"name":"site04"
},
{
"id":5,
"name":"site05"
}
]
},
{
"id": 2,
"name" : "ORG 2",
"site": [
{
"id":6,
"name":"site06"
},
{
"id":7,
"name":"site07"
}
]
},
{
"id": 3,
"name" : "ORG 3",
"site": [
{
"id":8,
"name":"site01"
},
{
"id":9,
"name":"site09"
},
{
"id":10,
"name":"site10"
}
]
},
{
"id": 4,
"name" : "ORG 4"
}
]
}
Many Thanks,
Alex