Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.
cvrebert edited this page Oct 12, 2014 · 1 revision

E020

.radio-inline should only be used on <label> elements

Wrong:

<span class="radio-inline">
  <input type="radio" name="someInlineRadioOptions" id="inlineRadio1" value="option1" /> Option one
</span>
<span class="radio-inline">
  <input type="radio" name="someInlineRadioOptions" id="inlineRadio2" value="option2" /> Option two
</span>

Right:

<label class="radio-inline">
  <input type="radio" name="someInlineRadioOptions" id="inlineRadio1" value="option1" /> Option one
</label>
<label class="radio-inline">
  <input type="radio" name="someInlineRadioOptions" id="inlineRadio2" value="option2" /> Option two
</label>

Incorrect markup used with the .radio-inline class. The correct markup structure is label.radio-inline>input[type="radio"]

.radio-inline requires a specific DOM structure. There cannot be any intervening layers of elements.

Wrong:

<label class="radio-inline">
  <span class="my-awesome-wrapper">
    <input type="radio" name="someInlineRadioOptions" id="inlineRadio1" value="option1" /> Option one
  </span>
</label>
<label class="radio-inline">
  <span class="my-awesome-wrapper">
    <input type="radio" name="someInlineRadioOptions" id="inlineRadio2" value="option2" /> Option two
  </span>
</label>

Right:

<label class="radio-inline">
  <input type="radio" name="someInlineRadioOptions" id="inlineRadio1" value="option1" /> Option one
</label>
<label class="radio-inline">
  <input type="radio" name="someInlineRadioOptions" id="inlineRadio2" value="option2" /> Option two
</label>
Clone this wiki locally