durusmail: quixote-users: Getting empty checkboxes from request
Getting empty checkboxes from request
2003-12-18
Re: Getting empty checkboxes from request
2003-12-18
Getting empty checkboxes from request
Thomas Guettler
2003-12-18
Hi!

I think you all now the problem:
You have a checkbox in a form, and you
don't know if the checkbox set or not, since
the browser don't send you values for
unchecked boxes.

request.form.get("mycheckbox")
will return None in both cases:
 1. The value was not displayed in
     the HTML form (the user could not check it)
 2. The value was displayed and
    not checked by the user.

I help me by adding a hidden form element "mycheckbox:savebool"

You have the same problem, when you want to display
a multiselect field with several single checkboxes.

How do you handle this?

  thomas





reply