De volgende JS wordt gegenereerd door PHP, het laadt dag nummers in voor een maandag in die maand. Nu wordt echter wanneer ik een maand verander niet alle vorige optie weggehaald.
het hele script staat op : http://www2.hku.nl/~patrick/indigo
het hele script staat op : http://www2.hku.nl/~patrick/indigo
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| <script language="javascript">
function selecteerMaand() {
for (i=0;i<document.logboek.dag.length;i++) {
document.logboek.dag.remove(i)
}
var maand = parseInt(document.logboek.maand.options[document.logboek.maand.selectedIndex].value);
switch(maand) {
case 8: document.logboek.dag.options[document.logboek.dag.length] = new Option('19', '19');
case 8: document.logboek.dag.options[document.logboek.dag.length] = new Option('12', '12');
[...]
case 1: document.logboek.dag.options[document.logboek.dag.length] = new Option('14', '14');
case 1: document.logboek.dag.options[document.logboek.dag.length] = new Option('7', '7');break;
}
}
</script> |