Author: ianb
Date: 2005-12-14 23:24:40 +0000 (Wed, 14 Dec 2005)
New Revision: 1421
Modified:
FormEncode/trunk/formencode/htmlfill.py
Log:
Fix case where a checkbox is a boolean, and the value attribute is not
considered (sometimes checkboxes are like multiselects, but sometimes not).
This is a regression from the previous use of select-box semantics
Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py 2005-12-12 23:02:45 UTC (rev
1420)
+++ FormEncode/trunk/formencode/htmlfill.py 2005-12-14 23:24:40 UTC (rev
1421)
@@ -328,7 +328,12 @@
self.skip_next = True
self.add_key(name)
elif t == 'checkbox':
- if self.selected_multiple(value, self.get_attr(attrs, 'value')):
+ selected = False
+ if not self.get_attr(attrs, 'value'):
+ selected = value
+ elif self.selected_multiple(value, self.get_attr(attrs, 'value')):
+ selected = True
+ if selected:
self.set_attr(attrs, 'checked', 'checked')
else:
self.del_attr(attrs, 'checked')
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs