From db798e24226b68d98bd658e057fd5d9844518a46 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 12 Sep 2011 18:18:14 +0000 Subject: Fix viewfunctions to not modify values --- lib/viewfunctions.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/viewfunctions.lua') diff --git a/lib/viewfunctions.lua b/lib/viewfunctions.lua index d7d25f8..5f923f5 100644 --- a/lib/viewfunctions.lua +++ b/lib/viewfunctions.lua @@ -102,12 +102,16 @@ function displayformitem(myitem, name, viewtype, header_level, group) myitem.name = tempname myitem.value = tempval elseif myitem.type == "boolean" then + local tempval = myitem.value if (myitem.value == true) then myitem.checked = "" end myitem.value = "true" io.write(html.form.checkbox(myitem) .. "\n") + myitem.value = tempval elseif myitem.type == "list" then + local tempval = myitem.value myitem.value = table.concat(myitem.value, "\n") io.write(html.form.longtext(myitem) .. "\n") + myitem.value = tempval else io.write((html.form[myitem.type](myitem) or "") .. "\n") end -- cgit v1.2.3