A form label must be associated with a control - Web:S6853

Hi,

I have this issue from SonarQube: “A form label must be associated with a control”
This is my code:

<div class="form-group row hidden">
    <label for="name" class="col-sm-2 col-form-label">
        <roundcube:label name="myclass.myobj.myprop.myattr" />
    <label>

    <div class="col-sm-10">
        <input type="text" class="form-control" id="name" name="name" disabled readonly>
    <div>
</div>

the “for attribute” referred to the name=“name” input attribute.
Do I miss anything?

Thanks in advance.
Ale

Hello @sen01,

We are aware of this issue, already listed here. The description of the rule is not complete. You are right that you already have a control associated with a label, but the label must have a description attached to it.

Cheers,
Victor