Add selection text
authorJoey Schulze <joey@infodrom.org>
Tue, 13 Apr 2010 08:07:19 +0000 (10:07 +0200)
committerJoey Schulze <joey@infodrom.org>
Tue, 13 Apr 2010 08:07:19 +0000 (10:07 +0200)
masks/arbeitsberichte.php

index 53e955f..93732ae 100644 (file)
@@ -28,7 +28,15 @@ function select_geraet_callback(data)
     var id = 'edit_anbaugeraet';
     if (num > 0) id += ':' + num;
 
-    select_update(id,data.info);
+    var obj = document.getElementById(id);
+
+    if (data.info.length) {
+      if (obj.options.length == 0)
+       obj.options[0] = new Option('Bitte w√§hlen Sie','',false,false);
+      select_update(id,data.info, 1);
+    } else
+      obj.options.length = 0;
+
 }
 
 function select_geraet(obj)