MySQL interesse |
|
Heb het zo opgelost:
<script type="text/javascript">
function verander(arr) {
applyToSelect(document.getElementById('sel1'),arr);
applyToSelect(document.getElementById('sel2'),arr);
applyToSelect(document.getElementById('sel3'),arr);
applyToSelect(document.getElementById('sel4'),arr);
applyToSelect(document.getElementById('sel5'),arr);
}
function applyToSelect(el, arr)
{
el.options.length = 0;
for(var i = 0; i< arr.length; i++ )
{
el.options[el.options.length] = new Option(arr[i], arr[i]);
el.options[el.options.length] = new Option("Other");
}
el.onchange = new Function("selectChanged(this);");
}
function selectChanged(el)
{
if(el.id == "select_citycenter")
el2 = document.getElementById("other1");
if(el.id == "sel2")
el2 = document.getElementById("other2");
if(el.id == "sel3")
el2 = document.getElementById("other3");
if(el.id == "sel4")
el2 = document.getElementById("other4");
if(el.id == "sel5")
el2 = document.getElementById("other5");
if(el.selectedIndex != el.options.length - 1)
el2.readOnly = true;
else
{
el2.readOnly = false;
el2.focus();
}
}
</script>
<script type="text/javascript"> function verander(arr) { applyToSelect(document.getElementById('sel1'),arr); applyToSelect(document.getElementById('sel2'),arr); applyToSelect(document.getElementById('sel3'),arr); applyToSelect(document.getElementById('sel4'),arr); applyToSelect(document.getElementById('sel5'),arr); } function applyToSelect(el, arr) { el.options.length = 0; for(var i = 0; i< arr.length; i++ ) { el.options[el.options.length] = new Option(arr[i], arr[i]); el.options[el.options.length] = new Option("Other"); } el.onchange = new Function("selectChanged(this);"); } function selectChanged(el) { if(el.id == "select_citycenter") el2 = document.getElementById("other1"); if(el.id == "sel2") el2 = document.getElementById("other2"); if(el.id == "sel3") el2 = document.getElementById("other3"); if(el.id == "sel4") el2 = document.getElementById("other4"); if(el.id == "sel5") el2 = document.getElementById("other5"); if(el.selectedIndex != el.options.length - 1) el2.readOnly = true; else { el2.readOnly = false; el2.focus(); } } </script>
|