AVT- Label 'For' attribute does not reference an appropriate form control

Summary

The id "identifier" referenced by the 'for' attribute of a label element is not a valid form input element or an element with id "identifier" is either null or does not exist.

Steps to reproduce

GitLab->Project->Issues-> New Issue

What is the expected correct behavior?

The label element's 'for' attribute must reference a non-null, non-empty unique ID in another valid form element such as an input, select or textarea, keygen, etc. Refer to the html specification for complete list of valid elements. When the 'for' attribute does not reference a corresponding unique ID in another valid form element, user agents do not have enough information to determine these essential relationships.

Possible fixes

Add unique 'id' attributes for each tag's input element which have 'for' attribute. The value of 'for' should be equals with the value of 'id' as below example 'fn1'.

For example:

  <form action="..." method="post">
        <fieldset>
            <legend>Legend text: Personal Information</legend>
            <p>Fieldset text: Please enter your personal information.</p>

            <label id="label1" for="fn1">First Name</label>
            <input type="text" name="firstname" id="fn1" value="enter first name">
        </fieldset>
    </form>

Relevant screenshots

  • [Project Details page] image
  • image

@sharonchen @carmacleod

Edited by 🤖 GitLab Bot 🤖