Dreamweaver

Create accessible HTML forms

When you insert an HTML form object, you can make the form object accessible, and change the accessibility attributes later.

Add an accessible form object

  1. The first time you add accessible form objects, activate the Accessibility dialog box for form objects (see Optimizing the workspace for visual development).

    This is a one-time-only step.

  2. In the document, place the insertion point where you want the form object to appear.
  3. Select Insert > Form, and select a form object to insert.

    The Input Tag Accessibility Attributes dialog box appears.

  4. Complete the dialog box, and click OK. Here is a partial list of options:
    Note: The screen reader reads the name you enter as the Label attribute for the object.
    ID
    assigns an ID to the form field. This value can be used to refer to the field from JavaScript; it's also used as the value of the for attribute if you choose the Attach Label Tag Using For option under the Style options.

    Wrap With Label Tag
    Wraps a label tag around the form item, as follows:
    <label>
    <input type="radio" name="radiobutton" value="radiobutton">
    RadioButton1</label>

    Attach Label Tag Using For
    Uses the for attribute to wrap a label tag around the form item, as follows:
    <input type="radio" name="radiobutton" value="radiobutton" id="radiobutton">
    <label for="radiobutton">RadioButton2</label>

    This choice causes the browser to render text associated with a check box and radio button with a focus rectangle, and enables the user to select the check box and radio button by clicking anywhere in the associated text instead of just the check box or radio button control.

    Note: This is the preferred option for accessibility; however, the functionality may vary depending on the browser.

    No Label Tag
    Does not use a label tag, as follows:
    <input type="radio" name="radiobutton" value="radiobutton">
    RadioButton3

    Access Key
    Uses a keyboard equivalent (one letter) and the Alt key (Windows) or the Control key (Macintosh) to select the form object in the browser. For example, if you enter B as the Access Key, users with a Macintosh browser could type Control+B to select the form object.

    Tab Index
    Specifies a tab order for the form objects. If you set tab order for one object, you must set the tab order for all objects.

    Setting a tab order is useful when you have other links and form objects on the page and need the user to tab through them in a specific order.

  5. Click Yes to insert a form tag.

    The form object appears in the document.

    Note: If you press Cancel, the form object appears in the document, but Dreamweaver does not associate accessibility tags or attributes with it.

Edit accessibility values for a form object

  1. In the Document window, select the object.
  2. Do one of the following:
    • Edit the appropriate attributes in Code view.

    • Right-click (Windows) or Control‑click (Macintosh), and then select Edit Tag.