Created
November 13, 2014 19:28
-
-
Save Tjoosten/f337826a8748e7eeb705 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
function Dropdown(eenheid,regimenten) { | |
var A.B.L = <?php json_encode($Regimenten_ABL); ?> | |
switch (eenheid.value) { | |
case 'A.B.L': | |
regimenten.options.length = 0; | |
for (i = 0; i < colours.length; i++) { | |
createOption(regimenten, A.B.L[i], A.B.L[i]); | |
} | |
break; | |
default: | |
regimenten.options.length = 0; | |
break; | |
} | |
} | |
function createOption(ddl, text, value) { | |
var opt = document.createElement('option'); | |
opt.value = value; | |
opt.text = text; | |
ddl.options.add(opt); | |
} | |
</script> | |
<select id="eenheid" onchange="Dropdown(this,document.getElementById('regimenten'))"> | |
<option value="A.B.L">Belgisch Militair</option> | |
</select> | |
<select class="from-control "id="regimenten"> | |
</select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment