web/formwidgets.py
changeset 10479 b0417cacecd9
parent 10404 797db633d60c
child 10522 1660a0fa4f43
--- a/web/formwidgets.py	Tue May 06 10:28:23 2014 +0200
+++ b/web/formwidgets.py	Thu Jun 11 16:51:51 2015 +0200
@@ -1040,11 +1040,11 @@
         self.value = ''
         self.onclick = onclick
         self.cwaction = cwaction
-        self.attrs.setdefault('class', self.css_class)
 
     def render(self, form, field=None, renderer=None):
         label = form._cw._(self.label)
         attrs = self.attrs.copy()
+        attrs.setdefault('class', self.css_class)
         if self.cwaction:
             assert self.onclick is None
             attrs['onclick'] = "postForm('__action_%s', \'%s\', \'%s\')" % (