This is a migrated thread and some comments may be shown as answers.

Is Q1 2015 ready for checkboxes and radiobuttons where label element is immediately followed by an input element?

1 Answer 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Oscar
Top achievements
Rank 1
Oscar asked on 02 Apr 2015, 10:53 AM
Hi Kendo Team,
Q3 2014 documentation said the expected HTML for checkboxes and radiobuttons was as follows:
<!-- Kendo UI Checkbox -->
<input type="checkbox" id="checkbox" class="k-checkbox">
<label class="k-checkbox-label" for="checkbox"></label>
 
<!-- Kendo UI Radio button -->
<input type="radio" id="radiobutton" class="k-radio">
<label class="k-radio-label" for="radiobutton"></label>

Does Q1 2015 release give a solution for label in first place like this?
<!-- Kendo UI Checkbox -->
<label class="k-checkbox-label" for="checkbox"></label>
<input type="checkbox" id="checkbox" class="k-checkbox">

Kind regards,
Oscar.



1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 03 Apr 2015, 06:50 AM
Hello Oscar,

No, the label elements must be after the input elements. This is due to the CSS selectors for styling them, and supporting both flavors would double the selectors in complexity. However, you can safely have two labels for the checkbox:

    <label for="foo">Foo</label>

    <input id="foo" type="checkbox" class="k-checkbox" />
    <label class="k-checkbox-label" for="foo"></label>


Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Oscar
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or