aboutsummaryrefslogtreecommitdiffstats
path: root/util/dataforms.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-04-05 19:42:01 +0100
committerMatthew Wild <mwild1@gmail.com>2009-04-05 19:42:01 +0100
commiteabe7a306ee287e1292f4720405df0a7f1c9775b (patch)
tree718a56b134c9781e122481d98357e7d2f1c02a8e /util/dataforms.lua
parent017c2522ed87e82cfa6185163210da5afbd8fd10 (diff)
downloadprosody-eabe7a306ee287e1292f4720405df0a7f1c9775b.tar.gz
prosody-eabe7a306ee287e1292f4720405df0a7f1c9775b.zip
util.dataforms: Allow form layouts to specify default values for fields
Diffstat (limited to 'util/dataforms.lua')
-rw-r--r--util/dataforms.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/dataforms.lua b/util/dataforms.lua
index 58b45fd3..1a6807d8 100644
--- a/util/dataforms.lua
+++ b/util/dataforms.lua
@@ -29,7 +29,7 @@ function form_t.form(layout, data)
-- 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