Thread Link in Auswahlfeld: OnClick in <slect>-Tag? (8 answers)
Opened by Froschpopo at 2004-01-02 18:31

renee
 2004-01-02 18:42
#25390 #25390
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Du hast zwei Möglichkeiten (ich habe mir das auf flirtbude.de nicht angesehen, kannst Dir ja aber das bessere raussuchen ;-) ):
1.) Du packst das in ein Formular
Code: (dl )
1
2
3
4
5
6
7
<form action="http://localhost/goto.pl" method="post">
<select name="goto">
 <option="home">Startseite</option>
 <option="seite2">Seite 2</option>
</select>
<input type="submit">
</form>

2.) nimm die JavaScript-Funktion onchange(); Schließt dann aber die aus, die JS deaktiviert haben...
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<html>
<head>
<script language="JavaScript">
<!--
function goto(url){
  var seite = url;
  var url = 'http://localhost/'+seite+'.html';
  alert(seite);
  location.href=url;
}
-->
</script>
</head>
<!-- HTML-Seite -->
<body>
<select name="goto" onchange="goto(this.value);">
<option value="home">Startseite</option>
 <option value="index">Home</option>
</select>
</body>
</html>

beides untestet..

Edit: JS-Variante verbessert\n\n

<!--EDIT|renee|1073062341-->
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Link in Auswahlfeld: OnClick in <slect>-Tag?