Support empty first fields
authorJoey Schulze <joey@infodrom.org>
Fri, 12 Mar 2010 13:41:45 +0000 (14:41 +0100)
committerJoey Schulze <joey@infodrom.org>
Fri, 12 Mar 2010 13:41:45 +0000 (14:41 +0100)
lib/mask.php

index eb64b46..3ba8e77 100644 (file)
@@ -67,6 +67,9 @@ function build_form($name, $mask)
 
       $ret[] = sprintf('<label for="edit_%s">%s</label><br>', $id, $info['name']);
       $ret[] = sprintf('<select %s>', implode(' ', $v));
+      if (array_key_exists('option_empty',$info))
+       $ret[] = sprintf('<option value="">%s</option>',
+                        $info['option_empty']);
       if (is_array($info['options'])) $options = $info['options'];
       else $options = query_db($info['options']);
       foreach ($options as $row)