def horizontal_radios(f,v): table = SQLFORM.widgets.radio.widget(f,v) rows=table.elements('tr') table.components = [] table.append([row.elements('td') for row in rows]) return table
def form(): form=SQLFORM.factory( Field('clientagent', requires=IS_IN_SET(['client', 'agent']), default='client', widget=horizontal_radios,label='Client/Agent'), ... ... <tr class="even" id="no_table_clientagent__row1"><td class="w2p_fl"><label for="no_table_clientagent" id="no_table_clientagent__label">Client/Agent: </label></td><td class="w2p_fc"></td></tr><tr class="odd" id="no_table_clientagent__row2"><td class="w2p_fw" colspan="2"><table class="string" id="no_table_clientagent" name="clientagent"> <tr><td><td><input checked="checked" name="clientagent" type="radio" value="client" />client</td></td> <td><td><input name="clientagent" type="radio" value="agent" />agent< /td></td></tr></table></td></tr>... <td><td> and </td></td> seems to be too many there. Does it come from the function above or web2py itself? How to correct this? Julius