{{=form.custom.begin}} <input type="hidden" name="_form" value="new_game" /> <div id="new_game" class="centrd"> <div class="btn-group" data-toggle="buttons-radio"> <button type="button" class="btn btn-primary radio">Opt1</button> <button type="button" class="btn btn-primary radio">Opt2</button> </div>
etc etc
Field('opt'),
form = SQLFORM(db.games)
hoping someone can point me in the right direction, as the post title says I want to use a btn-group
<div id="thetable_thefield" name="thefield" class="btn-group" data-toggle="buttons-radio"><input type="radio" name="thefield" value="first" class="btn btn-primary radio"></input><input type="radio" name="thefield" value="second" class="btn btn-primary radio"></input></div>
<div id="thetable_thefield" name="thefield" class="btn-group" data-toggle="buttons-radio"><input type="button" name="thefield" value="first" class="btn btn-primary radio"></input><input type="button" name="thefield" value="second" class="btn btn-primary radio"></input></div>
T
hanks 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)?
<input type="hidden" name="opt" value="new_game" />
db.define_table('games', Field('parts', widget = SQLFORM.widgets.radio.widget, requires = IS_IN_SET({'Halves','Quarters'})),
etc
form = SQLFORM(db.games)
(in other words nothing special)
{{=form.custom.begin}} <input type="hidden" name="_form" value="new_game" />
<div class="btn-group batradio" data-toggle="buttons-radio"> <label class="btn btn-primary" for="partsOne"> <input id="partsOne" name="parts" type="radio" value="Halves" />Halves </label> <label class="btn btn-primary" for="partsTwo"> <input id="partsTwo" name="parts" type="radio" value="Quarters" />Quarters </label> </div>
etc
input[type="radio"] {display:none;}