• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Ausgabetext mit HTML-IFrame ersetzen

Padi

Neues Mitglied
Hallo zusammen

Ich habe ein kleines Problem. Ich möchte gerne die Ausgabetexte mit IFrames ersetzen. Wenn ich beispielsweise in den Dropdownlisten BMW M3 auswähle, sollte anstatt der Ausgabe "Text 11" ein iFrame bzw. Html eingebunden werden. Vielen Dank für eure Unterstützung.

Hier der gesamte Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script type="text/javascript" language="javascript">

var text_container = new Array(anzahl_kategorie);
text_container[0] = new Array("Text 0");

text_container[1] = new Array("-- Auswahl --",
"Text 13.",
"Text 14.",
"Text 15.",
"Text 16.",
"Text 17.",
"Text 18.",
"Text 19.");

text_container[2] = new Array("-- Auswahl --",
"Text 10.",
"Text 11.",
"Text 71.",
"Text 12.");

text_container[3] = new Array("-- Auswahl --",
"Text 7.",
"Text 8.",
"Text 9.",
"Text 92.");

text_container[4] = new Array("-- Auswahl --",
"Text 4.",
"Text 5.",
"Text 54.",
"Text 6.");

text_container[5] = new Array("-- Auswahl --",
"Text 1.",
"Text 2.",
"Text 28.",
"Text 3.");

var anzahl_kategorie = 7;
var optionenliste = new Array(anzahl_kategorie);
optionenliste[0] = new Array("-- Auswahl --");

optionenliste[1] = new Array("-- Auswahl --",
"A1",
"A2",
"A3",
"A4",
"A5",
"A6",
"A7");

optionenliste[2] = new Array("-- Auswahl --",
"M1",
"M3",
"X3",
"X5");

optionenliste[3] = new Array("-- Auswahl --",
"Mustang",
"Fusion",
"Mondeo",
"Fiesta");

optionenliste[4] = new Array("-- Auswahl --",
"Astra",
"Omega",
"Vectra",
"Manta");

optionenliste[5] = new Array("-- Auswahl --",
"MX5",
"MX3",
"RX5",
"RX8");

function auswahlwechsel()
{
for (loop = window.document.getElementById("auswahl_2").options.length-1; loop > 0; loop--)
{
window.document.getElementById("auswahl_2").options[loop] = null;
}
for (loop = 0; loop < optionenliste[window.document.getElementById("auswahl_1").selectedIndex].length; loop++)
{
window.document.getElementById("auswahl_2").options[loop] = new Option(optionenliste[window.document.getElementById("auswahl_1").selectedIndex][loop]);
}
window.getElementById.auswahl_2.selectedIndex = 0;
}

function textwechsel()
{
document.getElementById("ausgabe").innerHTML = text_container[window.document.getElementById("auswahl_1").selectedIndex][window.document.getElementById("auswahl_2").selectedIndex];
}

function set_orig()

{
window.getElementById.auswahl_1.selectedIndex = 0;
window.getElementById.auswahl_2.selectedIndex = 0;
}

window.onload = set_orig

// -->
</script>
</head>
<body>
<form>
<select id="auswahl_1" onchange="auswahlwechsel(); ">
<option>-- Auswahl --</option>
<option>Audi</option>
<option>BMW</option>
<option>Ford</option>
<option>Opel</option>
<option>Mazda</option>
</select>

<select id="auswahl_2" onchange="textwechsel();">
<option>-- Auswahl --</option>
<option></option>
<option></option>
</select>
<br />
<br />
<br />
<div id="ausgabe"></div>
</form>
</body>
</html>
 
Werbung:
Zurück
Oben