V
V
Vladimir2022-02-21 13:52:54
JavaScript
Vladimir, 2022-02-21 13:52:54

There is a database of cars (brand model) in JSON, I can’t make related selects, so that models would drop out when choosing a brand?

Fragment of the car base.

{  
   "AC": [
   "378 GT Zagato",
   "Ace",
   "Aceca",
   "Cobra"
  ],
  "Acura": [
   "CL",
   "CSX",
   "EL",
   "ILX",
   "Integra",
   "Legend",
   "MDX",
   "NSX",
   "RDX",
   "RL",
   "RLX",
   "RSX",
   "SLX",
   "TL",
   "TLX",
   "TSX",
   "ZDX"
  ],
  "Adler": [
   "Diplomat",
   "Trumpf Junior"
  ],
  "Alfa_Romeo": [
   "105/115",
   "145",
   "146",
   "147",
   "155",
   "156",
   "159",
   "164",
   "166",
   "1900",
   "2600",
   "33",
   "4C",
   "6",
   "6C",
   "75",
   "8C Competizione",
   "90",
   "Alfasud",
   "Alfetta",
   "Arna",
   "Brera",
   "Disco Volante",
   "Giulia",
   "Giulietta",
   "GT",
   "GTA Coupe",
   "GTV",
   "MiTo",
   "Montreal",
   "RZ",
   "Spider",
   "Sprint",
   "Stelvio",
   "SZ"
  ],
 }

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
mletov, 2022-02-21
@mletov

google -> js react cascading dropdown from json

A
Anton Litvinenko, 2022-02-22
@AntonLitvinenko

https://www.w3schools.com/howto/howto_js_cascading...

A
Alexander Vasiliev, 2022-02-22
@amvasiljev

Good afternoon.
Here is the plugin https://github.com/tuupola/jquery_chained
there is just an example with cars

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question