Benutze anstatt onblur lieber onChange.
Und probiers mal so:
Alles anzeigen
Und probiers mal so:
HTML-Quellcode
- <form name="Test" action="">
- <select type="text" name="Eingabe" onChange="pruefeInhalt()">
- <option>An Alle</option>
- <option>Nur an User</option>
- <option>Nur an Administratoren</option>
- <option>An einzelnen User/Admin</option>
- </select>
- </form>
- <script type="text/javascript">
- function pruefeInhalt() {
- if(document.Test.Eingabe.selectedIndex == 1){ //An alle
- document.write("<big>hallo mein name ist... 1</big>");
- return false;
- }
- else if(document.Test.Eingabe.selectedIndex == 2){ //Nur an User
- document.write("<big>hallo mein name ist... 2</big>");
- return false;
- }
- else if(document.Test.Eingabe.selectedIndex == 3){ //Nur an Administratoren
- document.write("<big>hallo mein name ist... 3</big>");
- return false;
- }
- else if(document.Test.Eingabe.selectedIndex == 4){ //An einzelnen User/Admin
- document.write("<big>hallo mein name ist... 4</big>");
- return false;
- }
- }
- </script>