Moin,
ich hab folgendes Problem.
Ich lasse mir per xml/xsl eine html-Datei erzeugen, die folgendermaßen aussieht:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>DSL Übung</title>
<script type="text/javascript">
function pruefen()
{
if((document.Box.Scriptbox.value == document.Loesung.Loesung.value) | (document.Box.Scriptbox.value == document.Loesung.Loesung2.value))
{
alert("Die Lösung ist richtig!");
return true;
}
else
{
alert("Die Lösung ist leider falsch!");
return false;
}
}
function attribute()
{
alert(document.SQL.SQL.name);
alert(document.Tabellen.Tabellen.name);
alert(document.Vergleiche.Vergleiche.name);
alert(document.Teil.Teil.name);
alert(document.SQL.name);
alert(document.Tabellen.name);
alert(document.Vergleiche.name);
alert(document.Teil.name);
alert(document.SQL.SQL.value);
alert(document.Tabellen.Tabellen.value);
alert(document.Vergleiche.Vergleiche.value);
alert(document.Teil.Teil.value);
}
</script>
</head>
<body>
<div align="center">
<h1>DSL - Übung</h1><br><br>
Aufgabenstellung: <br>
Folgende Tabelle ist gegeben:<br><table border="2">
<tr>
<td>TeilNr</td>
<td>Bezeichnung</td>
<td>Material</td>
<td>Gewicht</td>
</tr>
<tr>
<td>23</td>
<td>Schraube</td>
<td>Niro</td>
<td>3</td>
</tr>
<tr>
<td>56</td>
<td>Mutter</td>
<td>Niro</td>
<td>1</td>
</tr>
<tr>
<td>17</td>
<td>Bolzen</td>
<td>Verzinkt</td>
<td>17</td>
</tr>
<tr>
<td>88</td>
<td>Achse</td>
<td>Alu</td>
<td>5</td>
</tr>
<tr>
<td>12</td>
<td>Lager</td>
<td>Alu</td>
<td>8</td>
</tr>
</table>Finde das Teil, das die TeilNr. 56 hat!<br><br>
<form action=" " method="post" name="Loesung">
<input type="text" name="Loesung" value=" SELECT Bezeichnung FROM Teil WHERE TeilNr = 56">
<input type="text" name="Loesung2" value=" SELECT Bezeichnung FROM Teil WHERE TeilNr = 56;">
</form>
<table>
<tr>
<td>
<form action=" " method="post" name="Box">
<textarea rows="10" cols="30" name="Scriptbox" readonly>
</textarea><br>
</form>
</td>
<td>
<table>
<tr>
<td>SQL:
</td>
<td>
<form action=" " name="SQL" method="post">
<select name="SQL" size="1">
<option>SELECT </option>
<option>FROM </option>
<option>WHERE </option>
<option>LIKE </option>
<option>OR </option>
<option>AND </option>
<option>ORDER BY </option>
<option>ASC </option>
<option>DESC </option>
<option>COUNT( </option>
<option>DISTINCT </option>
<option>MAX( </option>
<option>MIN( </option>
<option>SUM( </option>
<option>AVG( </option>
<option>( </option>
<option>) </option>
<option>AS </option>
<option>RIGHT JOIN </option>
<option>LEFT JOIN </option>
<option>INNER JOIN </option>
<option>USING </option>
<option>ON </option>
<option>EXISTS </option>
<option>NOT </option>
<option>UNION </option>
<option>INTERSECT </option>
<option>MINUS </option>
<option>IS </option>
</select>
</form>
</td>
<td><input type="button" value="Einfügen" onclick="document.Box.Scriptbox.value = document.Box.Scriptbox.value.concat(' ').concat(document.SQL.SQL.value)"></td>
</tr>
<tr>
<td>Vergleiche:
</td>
<td>
<form action=" " name="Vergleiche" method="post">
<select name="Vergleiche" size="1">
<option>= </option>
<option>< </option>
<option>> </option>
<option><= </option>
<option>>= </option>
<option>NOT </option>
</select>
</form>
</td>
<td><input type="button" value="Einfügen" onclick="document.Box.Scriptbox.value = document.Box.Scriptbox.value.concat(' ').concat(document.Vergleiche.Vergleiche.value)"></td>
</tr>
<tr>
<td>Tabellen:
</td>
<td>
<form action=" " name="Tabellen" method="post">
<select name="Tabellen" size="1">
<option>Teil </option>
</select>
</form>
</td>
<td><input type="button" value="Einfügen" onclick="document.Box.Scriptbox.value = document.Box.Scriptbox.value.concat(' ').concat(document.Tabellen.Tabellen.value)"></td>
</tr>
<tr>
<td>Teil:
</td>
<td>
<form action=" " name="Teil" method="post">
<select name="Teil" size="1">
<option>* </option>
<option>TeilNr </option>
<option>Bezeichnung </option>
<option>Material </option>
<option>Gewicht </option>
</select>
</form>
</td>
<td><input type="button" value="Einfügen" onclick="document.Box.Scriptbox.value = document.Box.Scriptbox.value.concat(' ').concat(document.Teil.Teil.value)"></td>
</tr>
<tr>
<td>
Eingabe:
</td>
<td>
<form action=" " name="Eingabe" method="post">
<input name="Eingabe" type="text" size="15">
</form>
</td>
<td><input type="button" value="Einfügen" onclick="document.Box.Scriptbox.value = document.Box.Scriptbox.value.concat(' ').concat(document.Eingabe.Eingabe.value)"></td>
</tr>
<tr>
<td>
Löschen:
</td>
<td><br></td>
<td><input type="button" value="Löschen" onclick="document.Box.Scriptbox.value = ''"></td>
</tr>
</table>
</td>
</tr>
</table>
<input type="button" value="Überprüfen" onclick="pruefen()">
</div>
<input type="button" value="attribute" onclick="attribute()">
</body>
</html>
Das ist die generierte Html-Datei.
Im Firefox funktioniert alles super! Eventuell wird die datei da auch anders erzeugt!
Im IE allerdings funktionieren die Dropdown-Listen nicht (<select...>)
Die haben nämlich immer keinen Value, egal was man auswählt!
Dafür ist auch der Button attribute ganz unten da.
Dieser dient der Überprüfung. Wenn ich den anklicke erschient wenn oben in JavaScript steht: alert(document.SQL.SQL.value) eine Box, inder nichts drin steht! Somit kein value!
Woran kann das liegen?
Vielen Dank schonmal für die Hife
Gruß
Coopar