Form pattern guidance

The following guidance is for content creators to ensure compliance accessibility compliance

Redundant Entry

If a user enters any form data in to a form, this data must not be asked for again within the same session. Previously entered data must be either auto-populated or available for the user to select.

  • Goal - Make it easier for users to complete multi-step processes.
  • What to do - Don’t ask for the same information twice in the same session.
  • Why it’s important - Some people with cognitive disabilities have difficulty remembering what they entered before.

Success criteria

Information previously entered by or provided to the user that is required to be entered again in the same process is either:

  • auto-populated, or
  • available for the user to select.

Except when:

  • re-entering the information is essential,
  • the information is required to ensure the security of the content, or
  • previously entered information is no longer valid.

Further information on Redundant Entry from w3.org

Accessible Authentication (Minimum)

A cognitive function test (such as remembering a password or solving a puzzle) is not required for any step in an authentication process unless that step provides at least one of the following:

Alternative

Another authentication method that does not rely on a cognitive function test.

Mechanism

A mechanism is available to assist the user in completing the cognitive function test.

Object Recognition

The cognitive function test is to recognize objects.

Personal Content

The cognitive function test is to identify non-text content the user provided to the Web site.

Accessible Authentication (Enhanced)

Understanding Accessible Authentication (Enhanced)

A cognitive function test (such as remembering a password or solving a puzzle) is not required for any step in an authentication process unless that step provides at least one of the following:

Alternative

Another authentication method that does not rely on a cognitive function test.

Mechanism

A mechanism is available to assist the user in completing the cognitive function test.

Further information on Accessible Authentication from w3.org

{% extends '@uol-form' %}
<div class="uol-form__container uol-form-container--centered  ">

    <div class="uol-form__inner-wrapper">

        <h2 class="uol-form__title">Log in</h2>

        <div class="uol-rich-text">
            <div class="uol-form__additional-content uol-form__additional-content--before">
                <p>Not signed up? <a href="/">Register</a></p>
                <p>Forgot password? <a href="/">Reset password</a></p>
            </div>
        </div>

        <div id="formErrorId" class="uol-form__form-error" aria-label="Error" role="alert" aria-live="polite" tabindex="-1" data-form-error="true">

            <div class="uol-form__form-error__text">
                <p>Incorrect username or password combination, please check your details</p>
            </div>
        </div>

        <form class="uol-form" action="/example-form-action">

            <div class="uol-form__input-group  uol-form__input-group--block">

            </div>

            <div class="uol-form--button-block">

                <div class="uol-form__inputs-wrapper">

                    <div class="uol-form__input-container 
">

                        <label class="uol-form__input-label" for="usernameID">
                            <span class="uol-form__input-label__text">Username or email (required)</span>

                        </label>

                        <div class="uol-form__input-wrapper
               uol-form__input-wrapper--text
              " data-field-invalid=true>

                            <!--  -->

                            <input class="uol-form__input  uol-form__input--text" type="text" id="usernameID" name="usernameName" aria-invalid="true" value="" autocomplete="username" required>

                            <!--  -->
                        </div>

                    </div>

                    <div class="uol-form__input-container 
">

                        <label class="uol-form__input-label" for="passwordID">
                            <span class="uol-form__input-label__text">Password (required)</span>

                            <span class="uol-form__input__requirements" aria-hidden="true">

                                <span>Must be at least 8 characters </span>

                                <span>Must contain at least 1 uppercase letter </span>

                            </span>
                            <span class="hide-accessible">
                                Must be at least 8 characters, Must contain at least 1 uppercase letter,
                            </span>

                        </label>

                        <div class="uol-form__input-wrapper
               uol-form__input-wrapper--password
              " data-field-invalid=true>

                            <!--  -->

                            <input class="uol-form__input  uol-form__input--password" type="password" id="passwordID" name="passwordName" aria-invalid="true" value="" autocomplete="current-password" required>

                            <button type="button" class="uol-form__input--password-toggle" aria-controls="passwordID" data-password-visible="false" hidden></button>

                            <!--  -->
                        </div>

                    </div>

                </div>

                <div class="uol-form__button-wrapper">
                    <button class="uol-button uol-button--primary
    " type="submit">Log in</button>

                </div>

            </div>

        </form>

    </div>

</div>
{
  "form": {
    "heading_level": "h2",
    "form_centered": true,
    "action": "/example-form-action",
    "title": "Log in",
    "lead": null,
    "additional_info_before": "<p>Not signed up? <a href=\"/\">Register</a></p><p>Forgot password? <a href=\"/\">Reset password</a></p>",
    "button": {
      "style": "primary",
      "type": "submit",
      "content": "Log in"
    },
    "fields": [
      {
        "type": "text",
        "label": "Username or email",
        "autocomplete": "username",
        "required": true,
        "invalid": true,
        "id": "usernameID",
        "name": "usernameName"
      },
      {
        "type": "password",
        "label": "Password",
        "requirements": [
          {
            "item": "Must be at least 8 characters"
          },
          {
            "item": "Must contain at least 1 uppercase letter"
          }
        ],
        "autocomplete": "current-password",
        "required": true,
        "invalid": true,
        "id": "passwordID",
        "name": "passwordName"
      }
    ],
    "form_error": "<p>Incorrect username or password combination, please check your details</p>",
    "form_error_id": "formErrorId"
  }
}