Gino: Textarea über Auswahlliste ansprechen

Beitrag lesen

Hallo Leute.

  
<!DOCTYPE html  
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
<body>  
<form>  
   <textarea name="bemerkung" id="area"></textarea>  
   <br/>  
   <select name="bem_texte" onchange="InsertText(this).value; return false">  
        <option value=0>Standardisierte Bemerkungstexte einf&uuml;gen...</option>  
        <option value="Hello World">Hello World</option>  
        <option value="FooBar">FooBar</option>  
      </select>  
</form>  
  

  
  
<script>  
<!--  
function InsertText(select) {  
  
  var wert = select.options[select.options.selectedIndex].value;  
    alert(wert);  
  
  if (wert != "") {  
    document.forms[0].elements[0].value = select.options[select.options.selectedIndex].text;  
  }  
}  
// -->  
</script>  

</body>
</html>