Bjørn Henneberg
Bjørn Henneberg

Reputation: 67

Check Radio box when pressing label

I have some radio buttons and i would like them to be checked after i click their label.

this is my code before it has been rendered.

div class="btn-group-vertical max-width-100 btn-group-for-partial row col-xs-12" data-toggle="buttons">
                @foreach (var x in @Model.dwom.Options)
                {
                    <label for="@x"><input type="radio" name="elu.Answer" id="@x" value="@x"/>@x</label><br />
                }
</div>

this is my code after it has been rendered.

<label for="Poinsettia">
  <input type="radio" name="elu.Answer" id="Poinsettia" value="Poinsettia" />Poinsettia</label>
<br />
<label for="Mistletoe">
  <input type="radio" name="elu.Answer" id="Mistletoe" value="Mistletoe" />Mistletoe</label>
<br />
<label for="Ivy">
  <input type="radio" name="elu.Answer" id="Ivy" value="Ivy" />Ivy</label>
<br />
<label for="Holly">
  <input type="radio" name="elu.Answer" id="Holly" value="Holly" />Holly</label>
<br />

now on my site it doesn't work for some reason, but in this jsFiddle it does: jsFiddle.

the weird thing is that you can see it being clicked, as in it gets that bevel they do before you release the click.

Hopefully someone here can help me in the right direction to get this working again.

Upvotes: 0

Views: 53

Answers (1)

Bj&#248;rn Henneberg
Bj&#248;rn Henneberg

Reputation: 67

Okay nevermind i was an idiot.

the solution was the data-toggle that my outside div had, it shouldn't have buttons inside it.

Upvotes: 1

Related Questions