to fill a select with json javascript from arrays [message #175072] |
Wed, 10 August 2011 12:13 |
nawfer
Messages: 34 Registered: August 2011
Karma:
|
Member |
|
|
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
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’;
|
|
|