diff --git a/forms.tmpl b/forms.tmpl index e21b439..e215afd 100644 --- a/forms.tmpl +++ b/forms.tmpl @@ -181,7 +181,7 @@
#if action == "doreply": - + ${HiddenField(c, "subject", title)} #else: ${FieldValid(c, "subject", "Subject:")} ${TextWidget(c, "subject", title, maxlength=100)} diff --git a/forum.nim b/forum.nim index 5ac4ad6..d330dbe 100644 --- a/forum.nim +++ b/forum.nim @@ -103,6 +103,11 @@ proc TextWidget(c: TForumData, name, defaultText: string, return """""" % [ name, $maxlength, x, if size != -1: "size=\"" & $size & "\"" else: ""] +proc HiddenField(c: TForumData, name, defaultText: string): string = + let x = if defaultText != reuseText: defaultText + else: xmlEncode(c.req.params[name]) + return """""" % [name, x] + proc TextAreaWidget(c: TForumData, name, defaultText: string): string = let x = if defaultText != reuseText: defaultText else: xmlEncode(c.req.params[name])