Okay, for posterity's sake, here is how I got it working:
in model:
db.define_table('games',
Field('parts', widget = SQLFORM.widgets.radio.widget, requires =
IS_IN_SET({'Halves','Quarters'})),
etc
in controller:
form = SQLFORM(db.games)
(in other words nothing special)
in view:
{{=f
Thanks again Alan, but the name in the original was just an example and in
the second post I reverted to actual variables, which is why you see
"parts"... and alas that did not fix it.
that said I *think* I have it working, just need to battle through the CSS
nightmare that is bootstrap and fig
>
> Thanks Alan - I'm still trying to get the intended result: Bootstrap
> buttons that function like radio buttons. I studied fields being brought
> in as normal radios
>
Have you tried setting name="opt" for this input instead (leaving the
options with their original attributes)?
--
Re
Thanks Alan - I'm still trying to get the intended result: Bootstrap
buttons that function like radio buttons. I studied fields being brought
in as normal radios, and like you suggested added the names:
which DOES work until you change the type to button:
at which point the value is NO
>
> hoping someone can point me in the right direction, as the post title says
> I want to use a btn-group
>
Try using name="opt" for the input element. However, it would be better to
use a custom widget.
http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#Widgets
--
Resou
5 matches
Mail list logo