Skip to content
This repository has been 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

Open
pjfsilva opened this issue Jul 20, 2016 · 0 comments
Open

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

pjfsilva opened this issue Jul 20, 2016 · 0 comments

Comments

@pjfsilva
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants