This cannot be changed. The problem is how they behave according to HTML specs. They velue is either returned or not.
On Jul 4, 6:08 pm, Luis Goncalves <[email protected]> wrote: > Hello! > > It seems to me that the behavior of checkboxes is different and non-standard > from the rest of input types, causing one to handle it as a special case > (when trying to automate input field processing). > > In my application, an admin can create profile forms through a friendly > interface. These forms can include string, text, checkbox, and lists > (sets). > > A user of the system can see his current profile (rendered by generating a > form given a definition of the form elements stored in a database), and > edit it. > > The editing is very clean and straightforward: > > for field in event_fields: > value = form.vars[str(field.id)] > if value: > # check if entry already exists and update, otherwise > create > prev_entry = db( (db.event_profile_entry.person == me.id) > & (db.event_profile_entry.event == session.cur_event) & > > (db.event_profile_entry.event_profile_field == field.id) ).select().first() > if prev_entry: > prev_entry.update_record( data = value ) > else: > db.event_profile_entry.insert( person = me.id, event = > session.cur_event, event_profile_field = field.id, data = value ) > > EXCEPT that a checkbox either has a value = 'on' or = None. > If checkbox returned values of True or False, the code would work fine for > checkboxes too, but as it is now, they will require special code. > > Is it worth changing the behavior of checkbox to be more like the rest of > the input types? > > Thanks, > Luis.

