Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Tjoosten
Created November 13, 2014 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tjoosten/f337826a8748e7eeb705 to your computer and use it in GitHub Desktop.
Save Tjoosten/f337826a8748e7eeb705 to your computer and use it in GitHub Desktop.
<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