Coding » Java
Link per Pulldownmenü
28.06.2006 - 14:04

Die Auswahl kann direkt erfolgen, ohne das ein Absende- oder "Go"-Button gedrückt werden muss. Dafür sorgt der Befehl "onChange". Er bedeutet, dass die Funktion schon gestartet wird, sobald sich etwas innerhalb des Formulars ändert.




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

Quellcode


<script language="JavaScript">
function 
surfto(form) {
var 
myindex=form.select1.selectedIndex
if (form.select1.options[myindex].value != "0") {
location=form.select1.options[myindex].value;}
}
</
SCRIPT>
<
FORM NAME="form1">
<
SELECT NAME="select1" onChange="surfto(this.form)" SIZE=1>
<
OPTION SELECTED VALUE="0">
----- 
W&auml;hlen Sie aus: ----- </option>
<
OPTION VALUE="URL#1">URL#1 Beschreibung</option>
<OPTION VALUE="URL#2">URL#2 Beschreibung</option>
<OPTION VALUE="URL#3">URL#3 Beschreibung</option>
<OPTION VALUE="URL#4">URL#4 Beschreibung</option>
</SELECT>
</
FORM>


WEBI


gedruckt am 19.03.2026 - 23:59
http://www.hth-c.com/include.php?path=content/content.php&contentid=80