I analyzed code and think that is possible to use with a small change also for take this :

in JSON/javascript if I have 3 php’s array, how can insert their values in
3 selects?
the select also must to be dependant; example Car Brand->Car
Model->Accessories
I look guide but cannot understand how solve the problem
I notice that some module use json but cannot understand how work because they start not from an array php but from database and also are not simple module;

ARRAY BRAND
brand[01]='Brand 1';
...
brand[20]='Brand 20';

ARRAY MODEL (every brand have 3 models,total 60 models)
model[01][m01]=’model m01 of brand 1’;
model[01][m02]=’model m02 of brand 1’;
...
model[20][m59]=‘model m59 of brand 20’;
model[20][m60]=‘model m60 of brand 20’;

ARRAY ACCESSORIES (every models can to have n accessories; exmpl. m01-> 3
accessories,
m60 -> 2 access.)
accessories[m01][]=‘accessories 1 of model m01’;
accessories[m01][]=‘accessories 2 of model m01’;
accessories[m01][]=‘accessories 3 of model m01’;
……..
accessories[m60][]=‘accessories 1 of model m60’;
accessories[m60][]=‘accessories 2 of model m60’;

example

this

$.ajax({
type:'GET',
url:Drupal.settings.basePath,
success:updateProvinceField,
dataType:'json',
data: {
q:'addresses/

must to be adaptated whit the php array;

Comments

AlexisWilke’s picture

Status: Active » Fixed

All the code is licensed under the GPL. You can reuse it for your own purpose, you cannot change the license to a proprietary license though.

Thank you.
Alexis Wilke

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.