Allow default values for text input fields
authorJoey Schulze <joey@infodrom.org>
Fri, 4 Mar 2011 18:26:45 +0000 (19:26 +0100)
committerJoey Schulze <joey@infodrom.org>
Fri, 4 Mar 2011 18:26:45 +0000 (19:26 +0100)
lib/mask.php

index 951347d..621330e 100644 (file)
@@ -49,6 +49,7 @@ function build_form($name, $mask)
                 'name="'.$id.'"');
       $v[] = 'size="'.(empty($info['size'])?'10':$info['size']).'"';
       $v[] = 'type="'.($info['type']=='passwd'?'password':'text').'"';
+      $v[] = 'value="'.(empty($info['default'])?'':$info['default']).'"';
       $ret[] = sprintf('<label for="edit_%s">%s</label><br>', $id, $info['name']);
       $ret[] = sprintf('<input %s>', implode(' ', $v));
     } elseif ($info['type'] == 'date') {