Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #2300 -- Added required "value" attribute to CheckboxSelectMult…

…ipleField

form field. Converted the submitted data for the same field back into something
we can work with. Thanks, lerouxb@gmail.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3850 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit be053df69341e98ef46c6ec3429d8f0812aab9f0 1 parent 11416e4
Malcolm Tredinnick authored September 26, 2006

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  django/forms/__init__.py
3  django/forms/__init__.py
@@ -54,6 +54,7 @@ def prepare(self, new_data):
54 54
     def get_validation_errors(self, new_data):
55 55
         "Returns dictionary mapping field_names to error-message lists"
56 56
         errors = {}
  57
+        self.prepare(new_data)
57 58
         for field in self.fields:
58 59
             errors.update(field.get_validation_errors(new_data))
59 60
             val_name = 'validate_%s' % field.field_name
@@ -638,7 +639,7 @@ def render(self, data):
638 639
             if str(value) in str_data_list:
639 640
                 checked_html = ' checked="checked"'
640 641
             field_name = '%s%s' % (self.field_name, value)
641  
-            output.append('<li><input type="checkbox" id="%s" class="v%s" name="%s"%s /> <label for="%s">%s</label></li>' % \
  642
+            output.append('<li><input type="checkbox" id="%s" class="v%s" name="%s"%s value="on" /> <label for="%s">%s</label></li>' % \
642 643
                 (self.get_id() + escape(value), self.__class__.__name__, field_name, checked_html,
643 644
                 self.get_id() + escape(value), choice))
644 645
         output.append('</ul>')

0 notes on commit be053df

Please sign in to comment.
Something went wrong with that request. Please try again.