diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-04-05 19:42:01 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-04-05 19:42:01 +0100 |
commit | eabe7a306ee287e1292f4720405df0a7f1c9775b (patch) | |
tree | 718a56b134c9781e122481d98357e7d2f1c02a8e /util | |
parent | 017c2522ed87e82cfa6185163210da5afbd8fd10 (diff) | |
download | prosody-eabe7a306ee287e1292f4720405df0a7f1c9775b.tar.gz prosody-eabe7a306ee287e1292f4720405df0a7f1c9775b.zip |
util.dataforms: Allow form layouts to specify default values for fields
Diffstat (limited to 'util')
-rw-r--r-- | util/dataforms.lua | 2 |
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 |