forms.py: Checkbox doesn't work without a value attribute set

Bug #585428 reported by Bud P. Bruegger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
web.py
Fix Released
Undecided
Unassigned

Bug Description

Tried with web.py 3.3 and 3.4:

Using a Checkbox without the optional 'value' parameter comes out always False, no matter whether the box is checked or not.
An example is the example at http://webpy.org/form:

myform = form.Form(
...
    form.Checkbox('curly'),
...

Changed to
    form.Checkbox('curly', value='something'),
it works.

Revision history for this message
Bud P. Bruegger (bud-ancitel) wrote :

The following change seems to be the fix:

form.py line 298: (Checkbox.render)

substitute:
attrs['value'] = self.value

by:
attrs['value'] = self.value or self.name

Revision history for this message
Anand Chitipothu (anandology) wrote :
Changed in webpy:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.