Hi, I am a newbie,
i work local on my first website (maybe, it's a little too ambitious)
it try to put it together with the different demos, and without any knowledge of php itself 😉
i try to get a nested dropdown menu, by "overwrite" the demo-dynamic-dropdown.
... here are some pictures:
[attachment=0]dropdown.png[/attachment]
the first dropdown, with the different lands work very well,
but the second with shown "php code" in setup dont works:
there will come two more connected dropdown menus,
thanks for your help
greets Inco
i work local on my first website (maybe, it's a little too ambitious)
it try to put it together with the different demos, and without any knowledge of php itself 😉
i try to get a nested dropdown menu, by "overwrite" the demo-dynamic-dropdown.
... here are some pictures:
[attachment=0]dropdown.png[/attachment]
the first dropdown, with the different lands work very well,
but the second with shown "php code" in setup dont works:
<?php
$schools = array(
"bad" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"bay" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"ber" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"bra" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"bre" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"ham" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"hes" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"mec" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"nie" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"nor" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"rhe" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"sar" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"sax" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"saxa" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"sch" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
"thu" => array("uni" => Universität,"Kunst" => Kunsthochschulen,"HAW" => Hochschule für Angewandte Wissenschaften,"KH" => Kirchliche Hochschule,"BS" => Berufsschule,"BOS" => Berufsoberschule,"FOS" => Fachoberschule),
);
echo json_encode($schools[$form->data["Bundesland"]]);
there will come two more connected dropdown menus,
thanks for your help
greets Inco
Hi inco,
Assuming that you have setup everything correctly, you need to use the originating dropdown's "field name" which is "land" in your case:
Regards,
Max
Assuming that you have setup everything correctly, you need to use the originating dropdown's "field name" which is "land" in your case:
echo json_encode($schools[$form->data["land"]]);
Regards,
Max
This topic is locked and no more replies can be posted.