Quoting "Anand Chitipothu" <[email protected]>:
> Reported a bug.
>
> https://bugs.launchpad.net/webpy/+bug/498135
>
> I fixed the exception. Try using the latest trunk.
>
> http://github.com/webpy/webpy/commit/43add10136eb503618116b3df683cae23a580c63
Many thanks!
> Checkboxes are tricky. They have an attribute called value, which is
> different from its value.
> In 0.32, checkbox.value used to return its value and 0.33 returns the
> value of attribute "value" and get_value() returns the actual value
> that is the checked status.
I see, but it doesn't work for me with 0.33. With the following
code I get always "False, True" (the original values) as result,
independent of the user input:
import web
template = '<form name="main" method="post">%s<input type="submit"/></form>'
urls = ('/', 'index')
app = web.application(urls, globals())
myform = web.form.Form(web.form.Checkbox('A', checked=False),
web.form.Checkbox('B', checked=True))
class index:
def GET(self):
form = myform()
return template % form.render()
def POST(self):
form = myform()
if not form.validates():
return template % form.render()
else:
return "Results: %s, %s" % (form['A'].get_value(),
form['B'].get_value())
if __name__=="__main__":
web.internalerror = web.debugerror
app.run()
How do I get the checked status of the checkbox?
Thanks in advance!
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.