[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - vocabularywidget.py:1.42
Fred L. Drake, Jr.
fred@zope.com
Tue, 17 Jun 2003 10:24:49 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv6493
Modified Files:
vocabularywidget.py
Log Message:
Do the proper XHTML thing for flag attributes.
=== Zope3/src/zope/app/browser/form/vocabularywidget.py 1.41 => 1.42 ===
--- Zope3/src/zope/app/browser/form/vocabularywidget.py:1.41 Mon Jun 16 17:52:41 2003
+++ Zope3/src/zope/app/browser/form/vocabularywidget.py Tue Jun 17 10:24:49 2003
@@ -147,11 +147,13 @@
def mkselectionitem(self, type, name, term, selected, disabled):
flag = ""
if selected:
- flag = "checked "
+ flag = " checked='checked'"
if disabled:
- flag += "disabled "
+ flag += " disabled='disabled'"
+ if flag:
+ flag = "\n " + flag
return ("<tr><td>"
- "<input type='%s' value='%s' name='%s' %s/>"
+ "<input type='%s' value='%s' name='%s'%s />"
"</td>\n <td>%s</td></tr>"
% (type, term.token, name, flag, self.textForValue(term)))
@@ -377,7 +379,7 @@
msgid = self.__actions[action]
return ("<input type='submit' name='%s.action-%s' value=%s %s/>"
% (self.name, action, quoteattr(self.translate(msgid)),
- disabled and "disabled " or ""))
+ disabled and "\n disabled='disabled' " or ""))
class VocabularyEditWidgetBase(VocabularyWidgetBase):