dimanche 13 mars 2016

independent checkbox and radio in the same group

I would like to use the btn-group of the bootstrap package to display set of buttons in a single group/row. In my case group consists of:

  • 1 checkbox
  • 3 radio buttons

Is it possible to make them work independently? (without jQuery?)

Currently when I click on radio button - my checkbox is no longer active..

code:

<div class="btn-group" data-toggle="buttons">

  <label class="btn btn-default active">
    <input type="checkbox" name="options2" autocomplete="off" checked>
    <span class="glyphicon glyphicon-ok"></span>
    Checkbox
  </label>

  <label class="btn btn-primary">
    <input type="radio" name="options" id="option1" autocomplete="off"> Radio 1
  </label>
  <label class="btn btn-primary active">
    <input type="radio" name="options" id="option2" autocomplete="off" checked> Radio 2
  </label>
  <label class="btn btn-primary">
    <input type="radio" name="options" id="option3" autocomplete="off"> Radio 3
  </label>
</div>

fiddle: http://ift.tt/22dQgBq




Aucun commentaire:

Enregistrer un commentaire