Skip to content
This repository was archived by the owner on May 1, 2018. It is now read-only.

Add suport for form elements with a label without 'for' defined #16

@pjfsilva

Description

@pjfsilva

It seems from the code that this only supports labels when defined like so:

<input type="checkbox" name="a" id="delete-confirm44" class="styled"/>
<label for="delete-confirm44">label</label>

but it does not support a perfectly HTML valid label format of putting the input inside the label and not defining the 'for' like so:

<label>
<input type="checkbox" name="a" id="delete-confirm44" class="styled"/>
label text
</label>

Looking at the code this isn't supported since 'for' is required to make the connection between input and label but an alternative can be tested to get the parent of the input if that's a label. It's a bit more code but this would make it work on both HTML valid usages.

I can try to do a patch, is that something anyone else is interested?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions