[web formwidgets] add missing tabindex to jquery date and time widgets (closes #1568475) stable
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Mon, 28 Mar 2011 15:16:11 +0200
branchstable
changeset 7115 1f1d8c35cc3e
parent 7114 d80c8c30aba7
child 7116 dfd4680a23f0
[web formwidgets] add missing tabindex to jquery date and time widgets (closes #1568475)
web/formwidgets.py
--- a/web/formwidgets.py	Mon Mar 28 14:49:22 2011 +0200
+++ b/web/formwidgets.py	Mon Mar 28 15:16:11 2011 +0200
@@ -594,8 +594,11 @@
             value = self.values(form, field)[0]
         else:
             value = self.datestr
+        attrs = {}
+        if self.settabindex:
+            attrs['tabindex'] = req.next_tabindex()
         return tags.input(id=domid, name=domid, value=value,
-                          type='text', size='10')
+                          type='text', size='10', **attrs)
 
 
 class JQueryTimePicker(FieldWidget):
@@ -620,6 +623,9 @@
             value = self.values(form, field)[0]
         else:
             value = self.timestr
+        attrs = {}
+        if self.settabindex:
+            attrs['tabindex'] = req.next_tabindex()
         return tags.input(id=domid, name=domid, value=value,
                           type='text', size='5')