#9336: CheckboxInput should render 'False' value as unchecked
---------------------+------------------------------------------------------
 Reporter:  bthomas  |       Owner:  nobody    
   Status:  new      |   Milestone:            
Component:  Forms    |     Version:  1.0       
 Keywords:           |       Stage:  Unreviewed
Has_patch:  1        |  
---------------------+------------------------------------------------------
 Currently, BooleanField will accept a value of 'False' and convert it to a
 boolean False in cleaned_data, for the case where it accepts data from a
 hidden field. However, if it is rendered as a CheckboxInput widget again,
 it will be rendered as checked, as the string 'False' from the initial
 data is converted to a True value.

 {{{
 Failed example:
     w.render('is_cool', 'False')
 Expected:
     u'<input type="checkbox" name="is_cool" />'
 Got:
     u'<input checked="checked" type="checkbox" name="is_cool"
 value="False" />'
 }}}

 This was happening to me in a strange case of a form validating for the
 preview stage of FormPreview, but failing validation after the POST, but
 there are probably other cases where someone might want to render a hidden
 value of 'False' into a CheckboxInput.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9336>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to