Henning Bösch: onchange select mit IE7

Beitrag lesen

Hallo,

ich habe folgenden Quellcode:

  
<form action="#">  
  <p id="selectyear">Jahr ausw&auml;hlen:  
    <select id="yl" size="1" onchange="makePOSTRequest('url', 'year='+this.options[this.selectedIndex].value, 'text/html'); ">  
      <option selected="selected">2007</option>  
      <option>2006</option>  
      <option>2005</option>  
      <option>2004</option>  
      <option>2003</option>  
      <option>2002</option>  
      <option>2001</option>  
    </select>  
  </p>  
</form>  
  

Im Mozilla und im Opera funktioniert das auch wunderbar. Nur der IE7 zickt rum.

  
this.options[this.selectedIndex].value 
~~~enthält bei ihm nicht den ausgewählten Wert. Ich habe es auch schon mit  
~~~javascript
  
getElementById('yl').options[getElementById('yl').selectedIndex].value

ausprobiert, aber ebenfalls Fehlanzeige.

Mit

  
alert(getElementById('yl').options[getElementById('yl').selectedIndex].value);

erhält man nur eine leere MessageBox.

Wie bekomme ich mit dem IE7 an den gerade in der Selectbox ausgewählten Wert heran.

Gruß,
Henning