Validität von Drop Down
Gitta
- javascript
0 Gunnar Bittersmann
0 Gitta
0 minicrispie1 MudGuard
Hallo,
mit folgendem JS-Schnipsel habe ich eine Drop-Down-Auswahl erstellt...
<form name="jump">
<select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO">
<option value="#">» Teamfilter</option>
<option value="news2.php?filter=1">Mutter</option>
<option value="news2.php?filter=2">Vater</option>
</select>
</form>
Leider ist der Code nicht valide,
"required attribute "ACTION" not specified."
Mir ist der Fehler bekannt, diese Zeile hilft einem ja gut weiter...
Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.
Doch an welcher Stelle im Code muss ich den Fehler beheben?
Vielen Dank, liebe Grüße
@@Gitta:
"required attribute "ACTION" not specified."
Doch an welcher Stelle im Code muss ich den Fehler beheben?
Beim http://de.selfhtml.org/html/formulare/definieren.htm#bereich@title='form'-Element.
Mir ist der Fehler bekannt, diese Zeile hilft einem ja gut weiter...
Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.
?? Wüsste nicht, wie diese Zeile _in diesem Fall_ weiterhilft.
Live long and prosper,
Gunnar
Da sage ich nur: Vielen Dank an Euch alle!
Hallo,
<form name="jump">
Doch an welcher Stelle im Code muss ich den Fehler beheben?
im form tag ... das benötigt IMMER ein "action"-attribut...
MfG. Christoph Ludwig
Hi,
[code lang=javascript]
<form name="jump">
Das form-Element ist überflüssig, da Du ja gar kein Formular abschicken willst.
<select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO">
Im Eventhandler kannst Du das betroffene Element mit this referenzieren, der Umweg über document ist überflüssig.
Damit ist auch das name-Attribut überflüssig. Und das nicht-existente value-Attribut ebenfalls:
<select onChange="location=this.options[this.selectedIndex].value;">
cu,
Andreas