• Das Erstellen neuer Accounts wurde ausgesetzt. Bei berechtigtem Interesse bitte Kontaktaufnahme über die üblichen Wege. Beste Grüße der Admin

auswahlbox(linkliste) in js

harald

New member
habe in einer neuen seite (http://home2.nexgo.de/aq/aquaterra70/Hauptseiten/4Programm_aquaterra70.htm) meiner homepage (www.aquaterra70.de) versucht, zwei Auswahlboxen in js (meine erst js-nutzung) zu integrieren (habe mich von einem beispiel in "teamone.de/selfhtml" anleiten lassen). Funktioniert jedoch nicht (auch nicht mit testeingabe der absoluten URL). was ist hier falsch?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<link rel=Edit-Time-Data href="1Programm_aquaterra70-Dateien/editdata.mso">
<title>4Programm aquaterra70</title>
<style><!--
.Normal
{font-size:12.0pt;
font-family:"Times New Roman";
color:black;}
-->
</style>
<meta http-equiv=Pragma content=no-cache>
<link rel="SHORTCUT ICON"
href="http://sitestatic.netscape.com/images/favicon.ico">
<script language="JavaScript">
<!--
function Go(x)
{
if(x == "nothing")
{
document.forms[0].reset();
document.forms[0].elements[0].blur();
return;
}
else if(x == "end") top.location.href = parent.frames[1].location;
else
{
parent.frames[1].location.href = x;
document.forms[0].reset();
document.forms[0].elements[0].blur();
}
}
//-->
</script>
</head>
<body bgcolor=#ffffff
background="../Grafik/Hintergrund/parchment.gif"
lang=DE link=blue vlink="#990099" alink="#0066cc" class="Normal" onLoad="">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="100" height="2" valign="top"></td>
<td width="125" height="2" valign="top"></td>
<td width="299" height="2" valign="top"></td>
<td width="3" height="2" valign="top"></td>
<td width="24" height="2" valign="top"></td>
<td width="208" height="2" valign="top"></td>
</tr>
<tr>
<td width="100" height="83" rowspan="3" valign="top"><img src="../Grafik/Gifs/Frog1.gif" width="100" height="72"></td>
<td width="125" height="3" valign="top"></td>
<td width="299" height="3" valign="top"></td>
<td width="3" height="3" valign="top"></td>
<td width="24" height="3" valign="top"></td>
<td width="208" height="3" valign="top"></td>
</tr>
<tr>
<td width="125" height="13" valign="top"></td>
<td width="299" height="13" valign="top"></td>
<td width="3" height="13" valign="top"></td>
<td width="24" height="13" valign="top"></td>
<td width="208" height="80" rowspan="2" valign="top"><select size=1 name="Auswahl" onChange=
"Go(this.form.Auswahl.options[this.form.Auswahl.options.selectedIndex].value)"
style="width:200px; background-color:#FFFFE0;
font-size:9pt; font-family:Arial,sans-serif;" width=450>
<option value="nothing">Auswahlbox
<option value="nothing">------------------------
<option value="../index.html">Startseite
<option value="nothing">------------------------
<option value="http://home2.nexgo.de/aq/aquaterra70/Hauptseiten/Vorwort_aquaterra70.html">Vorwort
<option value="1Programm_aquaterra70.html">Programm
<option value="1Börse_aquaterra70.html">Online-Boerse
<option value="1Vereinsnachrichten_aquaterra70.html">Vereinsnachrichten
<option value="1Fischkrankheiten_aquaterra70.html">Fischkrankheiten
<option value="1Links_aquaterra70.html">Links
<option value="1Kontakt_aquaterra70.html">Kontakte
<option value="1Impressum_aquaterra70.html">Impressum
<option value="nothing">------------------------
<option value="end">Beenden
</select>
<form>
</form></td>
</tr>
<tr>
<td width="125" height="67" valign="top"></td>
<td width="302" height="67" colspan="2" valign="top"><p align=center style='text-align:center'><b><span
style='font-size:24.0pt;font-family:Arial'><font size="7">aquaterra 70</font></span></b></p></td>
<td width="24" height="67" valign="top"></td>
</tr>
<tr>
<td width="100" height="2" valign="top"></td>
<td width="125" height="2" valign="top"></td>
<td width="299" height="2" valign="top"></td>
<td width="3" height="2" valign="top"></td>
<td width="24" height="2" valign="top"></td>
<td width="208" height="226" rowspan="2" valign="top"><select size=1 name="select" onChange=
"Go(this.form.Auswahl.options[this.form.Auswahl.options.selectedIndex].value)"
style="width:200px; background-color:#FFFFE0;
font-size:9pt; font-family:Arial,sans-serif;" width=450>
<option value="nothing">Auswahlbox Programm
<option value="nothing">------------------------
<option value="1Programm_aquaterra70.html">Programm 1
<option value="2Programm_aquaterra70.html">Programm 2
<option value="3Programm_aquaterra70.html">Programm 3
<option value="4Programm_aquaterra70.html">Programm 4 ab 09/01
<option value="nothing">------------------------
<option value="end">Beenden
</select></td>
</tr>
<tr>
<td width="100" height="224" valign="top"></td>
<td width="125" height="224" valign="top"></td>
<td width="299" height="224" valign="top"><a
href="../Grafik/Internetbilder/IPics/Falterfisch.jpg"><span
style='color:black;text-decoration:none;text-underline:none'><img border=0
width=299 height=224 id="_x0000_i1036"
src="../Hauptseiten/../Grafik/Internetbilder/IPics/Falterfisch.jpg" alt=Pinzettfisch></span></a></td>
<td width="3" height="224" valign="top"></td>
<td width="24" height="224" valign="top"></td>
</tr>
<tr>
<td width="100" height="2" valign="top"><img width="100" height="1" src="transparent.gif"></td>
<td width="125" height="2" valign="top"><img width="125" height="1" src="transparent.gif"></td>
<td width="299" height="2" valign="top"><img width="299" height="1" src="transparent.gif"></td>
<td width="3" height="2" valign="top"><img width="3" height="1" src="transparent.gif"></td>
<td width="24" height="2" valign="top"><img width="24" height="1" src="transparent.gif"></td>
<td width="208" height="2" valign="top"><img width="208" height="1" src="transparent.gif"></td>
</tr>
</table>
<iframe src="http://baseportal.de/cgi-bin/baseportal.pl?htx=/aquaterra70/Programm" name="db Programm" width=755 height=1500 align=left hspace=0 vspace=50 scrolling=no>
Dieser Vermerk wird angezeigt, wenn der Browser den Befehl nicht kennt
</body>
</html>


PS.: ich habe für die gestaltung "dreamweaver 3" benutzt, da ich sonst bis jetzt nur geringe programmierkenntnisse habe.
 
Als erstes mußt Du vor dem Select den Formtag setzen.
Zweitens gibt es auf Deiner Seite nicht frames[1]
es muß frames[0] heißen. und wenn Du eine neue Seite
öffnen willst, dann schreibe: window.location.href=x;

Gruß Steffen
 
danke steffen.
ganz komm ich jedoch noch nicht klar. habe die seite noch einmal überarbeitet und zwei frames untereinander gesetzt.

http://home.nexgo.de/aquaterra70/Hauptseiten/fs_aquaterra70.htm

jetzt funktioniert die auswahl so, daß die gewählte seite im oberen frame erscheint, anstatt dass sie nur im unteren wechselt.

<html>
<head>
<title>1tf_aquaterra70</title>
<script language="JavaScript">
<!--
function Go(x)
{
if(x == "nothing")
{
document.forms[0].reset();
document.forms[0].elements[0].blur();
return;
}
else if(x == "end") window.location.href = parent.frames[0].location;
else
{
parent.frames[0].window.location.href = x;
document.forms[0].reset();
document.forms[0].elements[0].blur();
}
}
//-->
</script>
</head>
<body background="../Grafik/Hintergrund/orange-paper.gif">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="97" height="37" valign="top"></td>
<td width="180" height="132" rowspan="3" valign="top"><img src="../Grafik/Gifs/Frog1.gif" width="180" height="132"></td>
<td width="55" height="37" valign="top"></td>
<td width="292" height="37" valign="top"></td>
<td width="63" height="37" valign="top"></td>
<td width="208" height="37" valign="top"></td>
</tr>
<tr>
<td width="97" height="2" valign="top"></td>
<td width="55" height="2" valign="top"></td>
<td width="292" height="97" rowspan="2" valign="top">
<div align="center"><p><b><span
style='font-size:24.0pt;font-family:Arial'><font color="#00FF00" face="Arial, Helvetica, sans-serif" size="7">aquaterra
70</font></span></b></p>
</div></td>
<td width="63" height="2" valign="top"></td>
<td width="208" height="2" valign="top"></td>
</tr>
<tr>
<td width="97" height="82" valign="top"></td>
<td width="55" height="82" valign="top"></td>
<td width="63" height="82" valign="top"></td>
<td width="208" height="82" valign="top">
<form>
<select size=1 name="Auswahl" onChange="Go(this.form.Auswahl.options[this.form.Auswahl.options.selectedIndex].value)"
style="width:200px; background-color:#FFFFE0;
font-size:9pt; font-family:Arial,sans-serif;" width=250>
<option value="nothing">Auswahlbox
<option value="nothing">------------------------
<option value="../index.html">Startseite
<option value="nothing">------------------------
<option value="1Vorwort_aquaterra70.html">Vorwort
<option value="1Programm_aquaterra70.html">Programm
<option value="1Börse_aquaterra70.htm">Online-Boerse
<option value="1Vereinsnachrichten_aquaterra70.html">Vereinsnachrichten
<option value="1Fischkrankheiten_aquaterra70.html">Fischkrankheiten
<option value="1Links_aquaterra70.html">Links
<option value="1Kontakt_aquaterra70.html">Kontakte
<option value="1Impressum_aquaterra70.html">Impressum
<option value="nothing">Gästebuch
<option value="nothing">------------------------
</select></form></td>
</tr>
<tr>
<td width="97" height="1" valign="top"><img width="97" height="1" src="transparent.gif"></td>
<td width="180" height="1" valign="top"><img width="180" height="1" src="transparent.gif"></td>
<td width="55" height="1" valign="top"><img width="55" height="1" src="transparent.gif"></td>
<td width="292" height="1" valign="top"><img width="292" height="1" src="transparent.gif"></td>
<td width="63" height="1" valign="top"><img width="63" height="1" src="transparent.gif"></td>
<td width="208" height="1" valign="top"><img width="208" height="1" src="transparent.gif"></td>
</tr>
</table>
</body>
</html>

was ist denn jetzt noch falsch???
 
bin der verzweiflung nahe. ein zweiter versuch will nicht zum ziel führen. siehe:

http://home.nexgo.de/aquaterra70/fs/versuch2fs.htm

die im topframe ausgewählte seite soll jeweils im unteren frame erscheinen. tut sie aber nicht. bei auswahl erscheint z.b."gästebuch" im oberen frame. oder bei auswahl "Vorwort" oder "Programm" findet er die seite nicht.

das frameset lautet:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function Go(x)
{
if(x == "nothing")
{
document.forms[0].reset();
document.forms[0].elements[0].blur();
return;
}
else if(x == "end") window.location.href = parent.frames[0].location;
else
{
parent.frames[0].window.location.href = x;
document.forms[0].reset();
document.forms[0].elements[0].blur();
}
}
//-->
</script>
</head>
<frameset rows="130,302*" frameborder="NO" border="0" framespacing="0" cols="*">
<frame name="tf1_aquaterra70" scrolling="NO" noresize src="fs_aquaterra70.htm">
<frame name="bf1_aquaterra70" src="1Vorwort_aquaterra70.html">
</frameset>
<noframes></noframes>
<body bgcolor="#FFFFFF">
<form>
<select size=1 name="Auswahl" onChange="Go(this.form.Auswahl.options[this.form.Auswahl.options.selectedIndex].value)"
style="width:200px; background-color:#FFFFE0;
font-size:9pt; font-family:Arial,sans-serif;" width=250>
<option value="nothing">Auswahlbox
<option value="nothing">------------------------
<option value="../index.html">Startseite
<option value="nothing">------------------------
<option value="1Vorwort_aquaterra70.html">Vorwort
<option value="http://www.baseportal.de/cgi-bin/baseportal.pl?htx=/aquaterra70/Programm">Programm
<option value="nothing">Online-Boerse
<option value="nothing">Vereinsnachrichten
<option value="nothing">Fischkrankheiten
<option value="nothing">Links
<option value="nothing">Kontakte
<option value="nothing">Impressum
<option value="http://www.nexgo.de/e/pub/homepage/gaestebuch/guest.php3?pagename=370841">Gästebuch
<option value="nothing">------------------------
</select>
</form>
</body>
</html>

wer kann helfen?

und könnte der bottom-frame auch noch einmal ähnlich aufgebaut sein, das heißt z.b. bottom-kopf mit 3 auswahlmöglichkeiten und zugehöriger bottom-bottom? ich hoffe, das ich verständlich gefragt habe.
 
hi harald,

Code:
<html>
<head>

<script language="JavaScript" type="text/javascript">
<!--
function surfto(form) {

var idx = form.select1.selectedIndex;

    if ( form.select1.options[idx].value != "0" ) {
        window.open(form.select1.options[idx].value, target="[color=red]main[/color]");
    }
  form.select1.options[0].selected = true;
}
//-->
</script>

</head>
<body>

<form name="form1">

<select name="select1" onchange="surfto(this.form);" size="1">
    <option selected>--- Auswählen ---
    <option>- - - - - - - - - - - - - - - -
    <option value="seite1.htm">Seite 1
    <option value="seite2.htm">Seite 2
    <option value="seite3.htm">Seite 3
    <option value="seite4.htm">Seite 4
    <option>
</select>

</form>

</body>
</html>
 
Zuletzt bearbeitet:
hallo rené,

danke erst noch einmal.
ich mach wohl etwas grundsätzliches falsch, denn es geht immer noch nicht.

im head habe ich dein script unverändert übernommen (richtig?)

im body sieht es so aus:
<form name="form1">
<select name="select1" onchange="surfto(this.form);" size="1">
<option selected>--- Auswählen ---
<option>- - - - - - - - - - - - - - - -
<option value="nothing">Auswahlbox Programm
<option value="nothing">------------------------
<option value="Programm1_aquaterra70.htm">Programm 1 bis 08/2001
<option value="Programm2_aquaterra70.htm">Programm 2 bis 08/2001
<option value="Programm3_aquaterra70.htm">Programm 3 bis 08/2001
<option value="http://www.baseportal.de/cgi-bin/baseportal.pl?htx=/aquaterra70/Programm">Programm ab 09/2001
<option value="nothing">------------------------
<option value="end">Beenden
</select>
</form>

die url der problemseite ist
http://home.nexgo.de/aquaterra70/fs/fs_Programm_aquaterra70.htm

kannst du mir helfen?
 
hi harald,

ich hab das erst garnicht gefunden bis ich mal den Quelltext von der index.... ( Frameset ) angesehen habe, was macht das da drin, da kanns auch nicht gehen das sieht nur der desen Browser keine Frames unterstützt.
 
Hallo zusammen!

Erstmal danke für den Quellcode, den kann ich gut gebrauchen. Ich benötige das gleiche nur als Mehrfachauswahl. Also Felder die voneinander abhängig sind wie z.b. Drucker: (Hersteller), Drucker (Model). Nach der AUswahl soll ein Link zu den Druckern führen. Ist so etwas machbar ?Für Tipps wäre ich sehr dankber!!:icon7:

Liebe Grüße

Nico
 
Zurück
Oben