problem ith checkboxes & radios when <label> is before the <input>
See original GitHub issuethe elements only work if out HTML looks like this:
<form>
<input>
<label></label>
</form>
However usually we see CMSs and apps using a structure like this:
<form>
<label></label>
<input>
</form>
or even this:
<form>
<label>
<input>
</label>
</form>
Currently these elements only work in Materialize if the <label>
element is after the <input>
Issue Analytics
- State:
- Created 9 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
CSS checkboxes & radio buttons when input is inside label?
I already have my sprite ready to go, I just need to figure the CSS out. My main issue is I can't figure...
Read more >Problem with my checkbox and radio buttons on survey form
Hi I don't understand why my checkboxes and radio buttons are not BEFORE their label on the web form and I don't understand...
Read more >Separate label and input for checkboxes/radios #22738 - GitHub
I need to separate a checkboxes label and input to conform with django forms. There's a similar issue #19095 where @patrickhlauke mentioned ...
Read more >Accessibility issues of checkboxes and radio buttons
Accessibility issues of checkboxes and radio buttons. This document discusses how to change a checkbox or radio button setting by using keyboard only, ......
Read more >Tabbing through form never gives focus to radio buttons or c
Hello, I'm having an issue where when I have either radio buttons or checkboxes on a form in Angular they never gain focus...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This slightly more robust version of @erichschroeter’s workaround did the trick for me:
$.each($(':checkbox'), function(k, v) { var label = $('label[for="' + this.id + '"]'); $(this).insertBefore(label); });
Well, for those that come across this still wondering if there’s a workaround, I think I found one. Just include jquery and include the following snippet.