Add support for decimal fields in form
[misc/kostenrechnung] / lib / mask.php
index 12a2d38..e3c7eab 100644 (file)
@@ -27,7 +27,8 @@ function build_form($name, $fields)
   $ret[] = sprintf('<input type="hidden" id="edit_source" name="source" value="%s">', $name);
 
   foreach ($fields as $id => $info) {
-    if ($info['type'] == 'text' || $info['type'] == 'passwd' || $info['type'] == 'number') {
+    if ($info['type'] == 'text' || $info['type'] == 'passwd' ||
+       $info['type'] == 'decimal' || $info['type'] == 'number') {
       $v = array('id="edit_'.$id.'"',
                 'name="'.$id.'"');
       $v[] = 'size="'.(empty($info['size'])?'10':$info['size']).'"';
@@ -53,7 +54,7 @@ function build_form($name, $fields)
     $ret[] = '<br>';
   }
 
-  $ret[] = '<span id="form_status"></span>';
+  $ret[] = '<span id="form_status">&nbsp;</span>';
   $ret[] = '<div class="buttons">';
   $ret[] = '<button id="button_save" onclick="return form_save(this);">Speichern</button>';
   $ret[] = '<span></span>';