I have been breaking my head with adding the below functionality in UI using HTML5 BOOTSTRAP-CSS-JS.
I am trying to create UI Dropdowns by consuming JSON input.
NOTE: The "JSON keys" are also to be consumed as dropdowns values rather than just the general "JSON values".. hence, i am unable to work out a logic for the same!
I have JSONs in the exact below format:
{
"BIKE LIST": {
"Bajaj": {
"Pulsar": {
"350 CC": [
"2019 Model",
"2020 Model"
],
"500 CC": [
"2018 Model",
"2021 Model"
]
}
}
},
"CAR LIST": {
"Toyota": {
"Etios": {
"Liva": [
"2019 Model",
"2020 Model"
],
"Regular": [
"2018 Model",
"2021 Model"
]
}
},
}
}
I would like to create 5 DYNAMIC dropdowns in UI as follows:
Dropdown 1 values: BIKE LIST, CAR LIST
Dropdown 2 ( values displayed according to user selection in Dropdown 1): i.e. if User selects BIKE LIST, I should have "Bajaj"
Dropdown 3 ( values displayed according to user selection in Dropdown 2): i.e. if User selects Bajaj, I should have "Pulsar"
Dropdown 4 ( values displayed according to user selection in Dropdown 3): i.e. if User selects Pulsar, I should have "350 CC", "500 CC"
Dropdown 5 ( values displayed according to user selection in Dropdown 4): i.e. if User selects 500 CC, I should have "2018 Model", "2021 Model"