durusmail: quixote-users: single word attributes in html.htmltag()
Unicode support for Quixote 2
2004-09-03
2004-09-03
2004-09-03
2004-09-03
Quixote / mod_python - test workflow?
2004-09-04
Re: R: [Quixote-users] Quixote / mod_python - test workflow?
single word attributes in html.htmltag()
2004-09-05
Re: single word attributes in html.htmltag()
2004-09-06
2004-09-04
2004-09-08
Python Best of Breed web app snippets / small webapps
2004-09-08
2004-09-10
2004-09-09
2004-09-09
2004-09-09
2004-09-09
single word attributes in html.htmltag()
Charles Brandt
2004-09-05
Hello,

I'm wondering if there is an existing way to set a single word attribute
(for lack of a better description) in an htmltag.  My specific need for this
is in the form2 package, I'd like to set a CheckboxWidget as "disabled"
(under certain circumstances).

details on the disabled input control available here:
http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.12

an example in html:


If nothing exists, I think it should be a simple change.  I've tried the
following in html.py which seems to work, but I'm not sure if there are
cases that this would break something:

***************
*** 80,87 ****
              val = attr
          if val is not None:
              r.append(' %s="%s"' % (attr, _escape_string(str(val))))
-         else:
-             r.append(' %s' % (attr) )
      if xml_end:
          r.append(" />")
      else:
--- 80,85 ----

Thanks in advance,
-Charles.



reply