Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Radio buttons with different value and description #13

Closed
fhsm opened this Issue May 12, 2010 · 1 comment

Comments

Projects
None yet
2 participants

fhsm commented May 12, 2010

The following webpy form:
simple_form = form.Form(
form.Radio('sex',
[('xy', 'male'),('xx', 'female')],
description='Select your sex',
),
)

Generates:
male
female

Not the expected:
male
female

I think this patch will fix the problem:
--- form.py 2010-03-20 13:40:07.000000000 -0400
+++ form_update.py 2010-05-10 13:05:30.000000000 -0400
@@ -262,8 +262,8 @@
attrs = self.attrs.copy()
attrs['name'] = self.name
attrs['type'] = 'radio'
- attrs['value'] = arg
- if self.value == arg:
+ attrs['value'] = value
+ if self.value == value:
attrs['checked'] = 'checked'
x += '<input %s/> %s' % (attrs, net.websafe(desc))
x += ''

From: http://groups.google.com/group/webpy/browse_thread/thread/b1de272a051b8d41

Contributor

anandology commented Aug 26, 2010

Fix bug in form.RadioButton when called with tuple options. Closed by 88163b4 (tx fhsm)

@s7v7nislands s7v7nislands pushed a commit to s7v7nislands/webpy that referenced this issue May 4, 2011

@anandology anandology Fix bug in form.RadioButton when called with tuple options. Closes #13
…(tx fhsm)
88163b4

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment