See answer here: http://stackoverflow.com/questions/5838926/web2py-how-can-i-use-images-in-radiobuttons-generated-from-a-sqlform/5839317#5839317
On Friday, April 29, 2011 9:54:26 PM UTC-4, naveed wrote: > I would like to generate a SQLFORM with radiobuttons using the > radiobutton widget as below (code trimmed): > > db.define_table('tabA', > Field('name', 'string', length=16, required=True, unique=True, ), > Field('shape', 'string', length=8, default='star', > widget=SQLFORM.widgets.radio.widget, requires=IS_IN_SET({'star' : > '<img src="/myapp/static/images/shapes/star1.png" />'}))) > > My problem is that the image code above gets sanitized and the image > tag doesn't show up. Can I turn off the sanitization for SQLFORM > somehow? Or is there a different elegant solution to this? My code > above shows only 1 radiobutton item for simplicity, but the items are > generated dynamically.