web/form.py
branchtls-sprint
changeset 1338 9e038f84dbb3
parent 1326 1d389a6b99b1
child 1360 13ae1121835e
--- a/web/form.py	Fri Apr 10 16:48:28 2009 +0200
+++ b/web/form.py	Fri Apr 10 16:48:48 2009 +0200
@@ -302,6 +302,10 @@
     def form_add_hidden(self, name, value=None, **kwargs):
         field = StringField(name=name, widget=fwdgs.HiddenInput, initial=value,
                             **kwargs)
+        if 'id' in kwargs:
+            # by default, hidden input don't set id attribute. If one is
+            # explicitly specified, ensure it will be set
+            field.widget.setdomid = True
         self.fields.append(field)
         return field