AW21 Rule 11.1.3

  • warning: Invalid argument supplied for foreach() in /home/tanaguru/www/sites/all/modules/contrib/cck/theme/content-field.tpl.php on line 35.
  • warning: Invalid argument supplied for foreach() in /home/tanaguru/www/sites/all/modules/contrib/cck/theme/content-field.tpl.php on line 35.
  • warning: Invalid argument supplied for foreach() in /home/tanaguru/www/sites/all/modules/contrib/cck/theme/content-field.tpl.php on line 35.
  • warning: Invalid argument supplied for foreach() in /home/tanaguru/www/sites/all/modules/contrib/cck/theme/content-field.tpl.php on line 35.
  • warning: Invalid argument supplied for foreach() in /home/tanaguru/www/sites/all/modules/contrib/cck/theme/content-field.tpl.php on line 35.
  • warning: Invalid argument supplied for foreach() in /home/tanaguru/www/sites/all/modules/contrib/cck/theme/content-field.tpl.php on line 35.
  • warning: Invalid argument supplied for foreach() in /home/tanaguru/www/sites/all/modules/contrib/cck/theme/content-field.tpl.php on line 35.
  • warning: Invalid argument supplied for foreach() in /home/tanaguru/www/sites/all/modules/contrib/cck/theme/content-field.tpl.php on line 35.
  • warning: Invalid argument supplied for foreach() in /home/tanaguru/www/sites/all/modules/contrib/cck/theme/content-field.tpl.php on line 35.
  • warning: Invalid argument supplied for foreach() in /home/tanaguru/www/sites/all/modules/contrib/cck/theme/content-field.tpl.php on line 35.
  • warning: Invalid argument supplied for foreach() in /home/tanaguru/www/sites/all/modules/contrib/cck/theme/content-field.tpl.php on line 35.

Summary

This test consists in checking the presence of the "for" attribute of each label tag associated with a form field. We assume here that a label is associated with a form field tag when its "for" attribute corresponds to the "id" attribute of any form field tag or when a form field is within the contents of the label.

Business description

Criterion :

11.1

Test :

11.1.3

Test description :

Does each label (label tag) that is associated with a form field (input tag of type text, password, checkbox, radio, file, or textarea and select tag) pass the conditions below?

  • The label tag has a for attribute
  • The value of the for attribute is equal to the value of the id attribute of the associated form field
Level :

Technical description

Scope :
Decision level :

Algorithm

Selection

Set1 (all implicit labels)
  • All the <label> tags of the page having a child node of type:
    • <textarea>
    • or <select>
    • or <input> with a "type" attribute equals to:
      •  "text"
      • or "password"
      • or "checkbox"
      • or "radio"
      • or "file
Set2 (all explIcit labels)
  • All the <label> tags of the page without child of type
    • <textarea>
    • or <select>
    • or <input> with a "type" attribute equals to
      • "text"
      • or "password"
      • or "checkbox"
      • or "radio"
      • or "file"
  • AND whose "for" attribute equals to the value of the "id" attribute of:
    • a <textarea> tag,
    • or a <select> tag
    • or an <input> tag with a "type" attribute equals to:
      • "text"
      • or "password"
      • or "checkbox"
      • or "radio"
      • or "file".

Process

Test1

For each element of Set1 (all implcit labels), test if the node contains a "for" attribute

For each occurrence of false-result of Test1, raise a MessageA

MessageA : For Missing Field
  • code : ForMissing
  • status: Failed
  • parameter : tag name
  • present in source : yes
Test2

For each element of Set1 (all implcit labels), test if the node contains a "for" attribute that corresponds to the "id" attribute value of its form field child element

For each occurrence of false-result of Test2, raise a MessageA

MessageB : Invalid For Attribute
  • code : InvalidForAttribute
  • status: Failed
  • parameter : tag name
  • present in source : yes
Test3

IF Set1 (all implicit labels) is empty

THEN test whether Set2 (all explicit labels) is not empty

ELSE return result of Test1 AND Test2

Analysis

NA

Set1 and Set2 are empty (the page has no label tag associated with a form field)

Failed

Test3 returns false

Passed

Test3 returns true

Notes

No notes yet for that rule