Hallo!
Habe folgendes Seite mit JavaScript
<html>
<head>
<title> </title>
</head>
<body>
<select name="F103" id="F103">
<option>Dienstreise</option>
<option>Seminar / Kurs / Lehrgang</option>
<option>GLAZ-Tag</option>
<option>Freizeit aus Mehrarbeit</option>
<option>Urlaub</option>
<option>Sonderurlaub</option>
<option>Saldokorrektur</option>
<option>Gutschrift abgeschnittener Stunden</option>
<option>Zeitkorrektur</option>
<option>Überstunden</option>
</select>
<br>----------------------------------<br>
<div id = "F1" style="visibility:visible">Stundenzahl</div>
<div id = "F2" style="visibility:visible">Sonderurlaub</div>
<div id = "F3" style="visibility:visible">Saldokorrektur</div>
<div id = "F4" style="visibility:visible">Gutschrift</div>
<div id = "F5" style="visibility:visible">Zeitkorretur</div>
<script type="text/Javascript">
~~~~~~javascript
<!--
document.getElementById('F103').onchange = switchView;
function switchView() {
document.getElementById('F1').style.visibility='visible';
document.getElementById('F2').style.visibility='visible';
document.getElementById('F3').style.visibility='visible';
document.getElementById('F4').style.visibility='visible';
document.getElementById('F5').style.visibility='visible';
var art = document.getElementById('F103').value;
if(art != 'Dienstreise' && art != 'Seminar / Kurs / Lehrgang' && art != 'GLAZ-Tag' && art != 'Freizeit aus Mehrarbeit' && art != 'Urlaub' && art != 'Sonderurlaub')
{
document.getElementById('F1').style.visibility='hidden';
}
if(art != 'Sonderurlaub')
{
document.getElementById('F2').style.visibility='hidden';
}
if(art != 'Saldokorrektur')
{
document.getElementById('F3').style.visibility='hidden';
}
if(art != 'Gutschrift abgeschnittener Stunden')
{
document.getElementById('F4').style.visibility='hidden';
}
if(art != 'Zeitkorrektur')
{
document.getElementById('F5').style.visibility='hidden';
}
}
-->
</script>
</body>
</html>
Soweit so gut.. Es soll halt abhängig von der Auswahl nur bestimmte Divs anzeigen. Im Firefox klappt dies auch ohne Probleme. Im IE dagegen wird egal bei welcher Auswahl einfach nichts angezeigt. Wisst ihr evtl woran das liegt?
Und wie kann ich es hinbekommen, das der Platz der Element, die nicht angezeigt werden, auch wieder freigegeben wird. Der Parameter Collapse klappt ja leider nur im Firefox!