Zum Inhalt springen

<select>-Menu funktioniert nur im Firefox aber nicht im IE

Erstellt am 1. Juli 2009 · 5 Antworten · letzte Antwort am 3. Juli 2009

Tags: HTML & CSS, Frage

TheFreeman ·

Hallo zusammen,

ich habe ein <select>-Menü gebastelt, was im FF wunderbar funtioniert. Aber leider nicht im IE, da springt er mir immer zur aktuellen Seite zurück.

Folgendes TS:

temp.schnellzugriff = COA
temp.schnellzugriff {

	wrap = <form name="form_schnellzugriff" action="{$baseURL}"  method="get" target="_self">|</form>

	10 = COA
	10 {
		wrap = <div class="schnell_1">|</div>
		
		10 = TEXT
		10.value = Schnellzugriff 1
		10.wrap = <div class="label">|</div>
	
		20 = HMENU
		20 {
			wrap (			
				<select name="select_group" size="1" onchange="window.location=this.options[this.selectedIndex].value">
					<option class="leer" value="" selected="1"></option>
					|
					<option class="leer" value=""></option>
				</select>
			)
			special = directory
			special.value = 5
			
			1 = TMENU
			1.expAll = 1
			1.NO = 1
			1.NO {
				doNotLinkIt = 1 
				
				stdWrap.cObject = COA
				stdWrap.cObject {
					
					10 = TEXT
					10 {
						wrap = <option class="lvl1" value="|">
						typolink {
							parameter.field = uid
							returnLast = url
						}
					}
					
					20 = TEXT
					20 {
						field = subtitle//title
						wrap =  |</option>
					}
				}
			}
			
			2 < .1
			2.NO.stdWrap.cObject.10.wrap = <option class="lvl2" value="|">
			2.NO.stdWrap.cObject.20.wrap = -&nbsp;|</option>
		}
	}
	
	20 < .10
	20 {
		wrap = <div class="schnell_2">|</div>
	
		10 = TEXT
		10.value = Schnellzugriff 2
		
		20.special.value = 3
	}
}

folgendes (Ausschnitt) wird generiert:

...
<form name="form_schnellzugriff" action="http://t3.domain.de/typo3instanz/" method="get" target="_self">
 <div class="schnell_alkitronic">
  <div class="label">Schnellzugriff 1</div>
   <select name="select_group" size="1" onchange="window.location=this.options[this.selectedIndex].value">
					
    <option class="leer" value="" selected="1"></option>
    <option class="lvl1" value="produktseiten/manuelle-schrauber/hg.html">Manuelle Schrauber</option>
    <option class="lvl2" value="produktseiten/manuelle-schrauber/hg.html">-&nbsp;HG</option>
    <option class="lvl1" value="produktseiten/pneumatische-schrauber.html">Pneumatische Schrauber</option>
    <option class="lvl2" value="produktseiten/pneumatische-schrauber/cls.html">-&nbsp;CLS</option>
    <option class="lvl2" value="produktseiten/pneumatische-schrauber/cls2.html">-&nbsp;CLS2</option>
    <option class="lvl2" value="produktseiten/pneumatische-schrauber/cld.html">-&nbsp;CLD</option>
    ...
   </select>
  </div>
 </div>
</form>

Warum klappt das im IE7 nicht? Ich checks net. #angry#

jenses ·

Wenn der doctype der Seite NICHT HTML4 ist (und davon gehe ich aus)
muß es selected="selected" heißen, selected="1" ist nicht valide.

TheFreeman ·

Da hast Du recht, der ist "XHTML 1.0 Transitional".
Aber warum springt er dann nicht dahin wo der jeweilige Menüpunkt hinzeigt?

TheFreeman ·

Danke Georg.
Das funktioniert schon einmal ganz gut mit den Verweisen.
Ich denke, dass Du da in Deiner Ausführung einen Fehler hast?
Denn der Parameter

 onchange="window.location=this.options[this.selectedIndex].value"

Funktioniert nicht, wenn er im FORM-Tag steht, sondern nur im SELECT-Tag.

Jetzt hab ich noch das Problem, daß die aktuelle Seite nicht "selected" wird, obwohl es drin steht.

Mein TS:

temp.schnellzugriff = COA
temp.schnellzugriff {

	wrap = <form name="form_schnellzugriff" action="" method="get" target="_self">|</form>

	10 = COA
	10 {
		wrap = <div class="schnell_alkitronic">|</div>
		
		10 = TEXT
		10.value = Schnellzugriff alkitronic
		10.lang.de = Schnellzugriff alkitronic
		10.lang.en = Quick access alkitronic
		10.lang.fr = À accès rapide alkitronic
		10.lang.sp = Acceso rápido alkitronic
		10.wrap = <div class="label">|</div>
	
		20 = HMENU
		20 {
			wrap (			
				<select name="select_group" size="1" onchange="window.location=this.options[this.selectedIndex].value">
					<option class="leer" value=""></option>
					|
					<option class="leer" value=""></option>
				</select>
			)
			special = directory
			special.value = 5
			
			1 = TMENU
			1.expAll = 1
			1 {
				NO = 1
				NO {
					doNotLinkIt = 1 
					
					stdWrap.cObject = COA
					stdWrap.cObject {
						
						10 = TEXT
						10 {
							wrap = <option class="lvl1" value="{getIndpEnv:TYPO3_SITE_URL}|">
							insertData = 1
							typolink {
								parameter.field = uid
								returnLast = url
							}
						}
						
						20 = TEXT
						20 {
							field = subtitle//title
							wrap =  |</option>
						}
					}
				}
				
				ACT = 1
				ACT < .NO
				ACT.stdWrap.cObject.10.wrap = <option class="lvl1" selected="selected" value="{getIndpEnv:TYPO3_SITE_URL}|">
			}
			
			2 < .1
			2.NO.stdWrap.cObject.10.wrap = <option class="lvl2" value="{getIndpEnv:TYPO3_SITE_URL}|">
			2.NO.stdWrap.cObject.20.wrap = -&nbsp;|</option>
			2.ACT.stdWrap.cObject.10.wrap = <option class="lvl2" selected="selected" value="{getIndpEnv:TYPO3_SITE_URL}|">
		}
	}
	
	20 < .10
	20 {
		wrap = <div class="schnell_alkitorc">|</div>
	
		10 = TEXT
		10.value = Schnellzugriff alkitorc
		10.lang.de = Schnellzugriff alkitorc
		10.lang.en = Quick access alkitorc
		10.lang.fr = À accès rapide alkitorc
		10.lang.sp = Acceso rápido alkitorc
		
		20.special.value = 3
	}
}

Meine Ausgabe:

<div id="schnellzugriff"><form name="form_schnellzugriff" action="" method="get" target="_self" onchange="window.location=this.options[this.selectedIndex].value"><div class="schnell_alkitronic"><div class="label">Schnellzugriff alkitronic</div><select name="select_group" size="1" onchange="window.location=this.options[this.selectedIndex].value">
					<option class="leer" value=""></option><option class="lvl1" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/manuelle-schrauber/m.html">Manuelle Schrauber</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/manuelle-schrauber/m.html">-&nbsp;M</option><option class="lvl1" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/pneumatische-schrauber.html">Pneumatische Schrauber</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/pneumatische-schrauber/cls.html">-&nbsp;CLS</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/pneumatische-schrauber/cls2.html">-&nbsp;CLS2</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/pneumatische-schrauber/cld-l.html">-&nbsp;CLD / L</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/pneumatische-schrauber/cld.html">-&nbsp;CLD</option><option class="lvl1" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/elektrische-schrauber.html">Elektrische Schrauber</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/elektrische-schrauber/efc.html">-&nbsp;EFC</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/elektrische-schrauber/ecw.html">-&nbsp;ECW</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/elektrische-schrauber/efcip-efcip-plus.html">-&nbsp;EFCip / EFCip plus</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/elektrische-schrauber/ecwip-ecwip-plus.html">-&nbsp;ECWip / ECWip plus</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/elektrische-schrauber/ef-efplus.html">-&nbsp;EF / EFplus</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/elektrische-schrauber/efw-efwplus.html">-&nbsp;EFW / EFWplus</option><a href="produktseiten/alkitronic/spezialloesungen.html" onfocus="blurLink(this);">Speziallösungen</a><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/spezialloesugen/efcip-r.html">-&nbsp;EFCip-R</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/spezialloesugen/ef-r.html">-&nbsp;EF-R</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/spezialloesugen/rcl.html">-&nbsp;RCL</option><a href="produktseiten/alkitronic/spezialloesugen/clv-r.html" onfocus="blurLink(this);">CLV-R</a><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/spezialloesugen/efcip-sg.html">-&nbsp;EFCip-SG</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/spezialloesugen/ef-sg.html">-&nbsp;EF-SG</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/spezialloesugen/cls-sg.html">-&nbsp;CLS-SG</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/spezialloesugen/clv-sg.html">-&nbsp;CLV-SG</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/spezialloesugen/n-tools.html">-&nbsp;N-Tools</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/spezialloesugen/clv.html">-&nbsp;CLV</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/spezialloesugen/fernbedienungen.html">-&nbsp;Fernbedienungen</option><option class="lvl1" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/getriebe.html">Getriebe</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/getriebe/g45.html">-&nbsp;G45</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/getriebe/zg-225.html">-&nbsp;ZG 225</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/getriebe/zg-1150.html">-&nbsp;ZG 1150</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/getriebe/zg-1250.html">-&nbsp;ZG 1250</option><option class="lvl1" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/qms-sdma.html">QMS - SDMA Statisch-Dynamische Messanlagen</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/qms-sdma/sdms-sm.html">-&nbsp;SDMS / SM</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/qms-sdma/if.html">-&nbsp;IF</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/qms-sdma/calibra-ks.html">-&nbsp;calibra KS</option><option class="lvl1" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/qms-mds-mini.html">QMS - MDS Montage-Dokumentations-Systeme Mini</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/qms-mds-mimi/minicardos.html">-&nbsp;miniCardos</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/qms-mds-mimi/hsd.html">-&nbsp;HSD</option><option class="lvl1" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/qms-mds.html">QMS - MDS Montage-Dokumentations-Systeme</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/qms-mds/cardos-os.html">-&nbsp;cardos OS</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/qms-mds/cardos-op.html">-&nbsp;cardos OP</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/qms-mds/esdx.html">-&nbsp;ESDx</option><option class="lvl1" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitronic/zubehoer.html">Zubehör</option><option class="leer" value=""></option>

				</select></div><div class="schnell_alkitorc"><div class="label">Schnellzugriff alkitorc</div><select name="select_group" size="1" onchange="window.location=this.options[this.selectedIndex].value">
					<option class="leer" value=""></option><option class="lvl1" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitorc/hydraulische-schrauber.html">Hydraulische Schrauber</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitorc/hydraulische-schrauber/at.html">-&nbsp;AT</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitorc/hydraulische-schrauber/atz.html">-&nbsp;ATZ</option><option class="lvl1" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitorc/hydraulikpumpen.html">Hydraulikpumpen</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitorc/hydraulikpumpen/nova.html">-&nbsp;NOVA</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitorc/hydraulikpumpen/lhp.html">-&nbsp;LHP</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitorc/hydraulikpumpen/ehp.html">-&nbsp;EHP</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitorc/hydraulikpumpen/ehpc.html">-&nbsp;EHPC</option><option class="lvl2" value="http://t3.ds-media-design.de/alkitechnik/produktseiten/alkitorc/hydraulikpumpen/ehpcplus.html">-&nbsp;EHPCplus</option><option class="leer" value=""></option>

				</select></div></form></div>

So wie´s aussieht, wird der ACT-Zustand nicht gewrapt, aber warum?
Kannst Dir hier ansehen: http://t3.ds-media-design.de/alkitechnik/home.html