I'm trying to display a field as a radio button group in a customised form. I want to place each radio button on a different row in a table. The problem is when I use {{=form.custom.selection_type[0]}}
, the widget is wrapped in unwanted tr
and td
tags. Is there a way to add only the radio button?
My form:
{{extend 'layout.html'}}
{{=form.custom.begin}}
<table>
<tr>
<td> {{=form.custom.selection_type[0]}}:</td>
<td> {{=form.custom.widget.biller_list}}</td>
</tr>
<tr>
<td> {{=form.custom.widget.selection_type[1]}}:</td>
<td> {{=form.custom.widget.biller_code}}</td>
</tr>
</table>
{{=form.custom.end}}
Example of what's happening in the html source code:
<table>
<tr>
<td> <tr><td><input name="selection_type" type="radio" value="From my biller list" />From my biller list</td></tr>:</td>
...
</tr>
...
</table>
My model:
db.define_table('payment_bpay_step1',
Field('selection_type', 'list:string'),
Field('biller_list', db.biller, notnull=True),
Field('biller_code'),
Field('biller_name'))
db.payment_bpay_step1.selection_type.requires = IS_IN_SET(('From my biller list', 'Search by biller code', 'Search by biller name'))
db.payment_bpay_step1.selection_type.widget = SQLFORM.widgets.radio.widget