# HG changeset patch # User Matthew Wild # Date 1238956921 -3600 # Node ID 34f8cda285c46cdbac6543edca675062c07734d2 # Parent 4c3f3d60a2f425b4b3a4645e123ff94fe8acb78e util.dataforms: Allow form layouts to specify default values for fields diff -r 4c3f3d60a2f4 -r 34f8cda285c4 util/dataforms.lua --- a/util/dataforms.lua Sun Apr 05 19:41:24 2009 +0100 +++ b/util/dataforms.lua Sun Apr 05 19:42:01 2009 +0100 @@ -29,7 +29,7 @@ -- Add field tag form:tag("field", { type = field_type, var = field.name, label = field.label }); - local value = data[field.name]; + local value = data[field.name] or field.value; -- Add value, depending on type if field_type == "hidden" then