Reputation: 133
I am unable to select radio button after creating it in Materialize.
Here is the code:
<div class="row">
<div class="input-field col s2">
<input name="gender" type="radio" id="male" value="Male" />
<label for="gender" style="font-size:12px;">Male</label>
</div>
<div class="input-field col s2">
<input name="gender" type="radio" id="female" value="Female"/>
<label for="gender" style="font-size:12px;">Female</label>
</div>
</div>
Upvotes: 2
Views: 2109
Reputation: 4773
The labels' for
attribute should match the ids on the checkboxes, not the name:
<label for="male">Male</label>
...
<label for="female">Female</label>
Upvotes: 7