Hi again, Sorry to have bothered you, found the solution - removed the 'boolean' type from the Field definition in the model, and everything works fine.
May I suggest a radio widget example in the book perhaps? Anyhow, thanks for making web2py, I'm getting things done with it :-) // Jens ---------- Forwarded message ---------- From: Jens Örtenholm <[email protected]> Date: 2011/3/29 Subject: sqlform.widget.radio.widget problem getting value To: [email protected] Hi, I've been trying to add a radio button set to one of my web forms. I'm generating the form with SQLFORM.factory, because I'm adding a non db field to it. Example model: db.define_table('mytable', Field('name', 'string', requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, ' mytable.name')]), # some fields omitted Field('radiofield', 'boolean', widget=SQLFORM.widgets.radio.widget, requires=IS_IN_SET({True : 'On', False : 'Off', None : 'Neither'}))) In the controller: def new(): form = SQLFORM.factory(db.mytable, Field('specialfield', 'string'), labels={'specialfield' : 'Special Field'}) if form.accepts(request.vars, session): # do some handling of special field, then a manual db insert, here omitted return dict(form=form, radio=form.vars.radiofield) # when not debugging this is a redirect to another controller return dict(form=form) The form shows with three radio buttons: On, Off and Neither. But no matter which one I choose, form.vars.radiofield is always True after calling form.accepts. Examining request.vars.radiofield variable, the correct chosen value is shown there. Am I doing something wrong here, or is it a bug? // Jens

