Topic: Checkbox not working
blackcurrantapps pro asked 7 years ago
<input type="checkbox" value="{{ $option }}" id="{{ $option->other_option_id }}"> <label for="{{ $option->other_option_id }}" class="label-table"></label>This doesn't work but when I append any string to it like "_check" it works.
<input type="checkbox" value="{{ $option }}" id="{{ $option->other_option_id }}_check"> <label for="{{ $option->other_option_id }}_check" class="label-table"></label>The second piece of code is able to manipulate checkbox state. I am not able to understand why the first piece of code doesn't work.
Mikołaj Smoleński staff answered 7 years ago
jordansgr answered 5 years ago
For my.
That works.https://prnt.sc/s06o51
That doesn't https://prnt.sc/s06oaa
Grzegorz Bujański staff commented 5 years ago
Hi. Input should be sibling with label - not children. Look at example here: https://mdbootstrap.com/docs/jquery/forms/checkbox/
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No