Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Regular checkboxes and radio buttons work fine, but when they are inside of a tableselect element they do not render properly.
I traced the issue down to an extra div being wrapped around the radio/checkbox element. To fix the problem either the label wrapper has to have content aside from the input:
<label for="xyz"><input type="radio" id="xyz" name="xyz"></label>
would need to be
<label for="xyz"><input type="radio" id="xyz" name="xyz"> XYZ</label>
But this messes up the view of the table select. Removing the extra div tag should work though.
Instead of this:
<div>
<td>
<label for="example-radio-button"> <input type="radio" id="example-radio-button name="example-radio-button" value="example_radio" class="form-radio"></label>
</td>
</div>
It should output this:
<td>
<label for="example-radio-button"> <input type="radio" id="example-radio-button name="example-radio-button" value="example_radio" class="form-radio"> </label>
</td>
Comment | File | Size | Author |
---|---|---|---|
#3 | bootstrap-tableselect-radio-checkbox-2118587-3.patch | 507 bytes | el7cosmos |
#3 | interdiff.txt | 547 bytes | el7cosmos |
#2 | bootstrap-tableselect-radio-checkbox-2118587-2.patch | 606 bytes | el7cosmos |
Comments
Comment #1
el7cosmosDuplicate #2116805: Regression? VBO checkboxes do not render
Comment #2
el7cosmosSorry, i think this is separate issue
Comment #3
el7cosmosCleaner way
Comment #4
el7cosmos@skriptble i don't have problem with label or extra div, i don't know if this same issue or not. The patch will work for checkbox or radio that become very small inside table
Comment #5
skriptble CreditAttribution: skriptble commentedThis works perfect for me!
Thanks!
Comment #6
markhalliwellThanks @el7cosmos!
Committed 468865d to 7.x-3.x: