|
Creating Accessible Forms with FrontPage 2003.WAC Workshop: December 2004. Written and Presented by: Lori Bailey. Want more help with accessible forms? Check out our Accessible Forms Tutorial. Marking Up HTML Form Elements.In this tutorial, we will consider each of the form elements and what information you need to include to insert these elements into your HTML form. Although we focus on HTML forms, the requirements are similar regardless of what kind of form it is -- PDF, scripted, or other -- although it may be more difficult to add the appropriate accessible markup. As an overview, you might want to begin by viewing a form with examples of all these elements. Processing Forms with FrontPage.By default, FrontPage relies on a special FrontPage client-side and server-side coding to process forms and manage form data. In most cases, this scripting appears in the form of a "webbot". For example, when a new form is created, FrontPage inserts the following HTML: <form method="POST"
action="--WEBBOT-SELF--"> In this webbot script called "--WEBBOT-SELF--", the results of the form are automatically saved to the comma-delineated file "form_results.csv." inside a FrontPage generated folder called "_private." This webbot will only work if you have a server that is running FrontPage Server Extensions: the special FrontPage scripts that run these features. If you do have a server that supports FrontPage Server Extensions, you can use these automated features to process your forms. However, be aware that many FrontPage scripts require users to be using the latest version of Internet Explorer and some may cause fatal errors in non-Microsoft browsers. Test your forms in other browsers like Opera or Mozilla Firefox to insure full compatibility. For this tutorial, we are going to disable these FrontPage scripts and use a PHP script instead. You can run this script on any server that offers PHP support. Disable FrontPage Web Components.
Here is what the Authoring options window should look like
when you are done: Hands-on Practice
You can follow-along with this tutorial if you have FrontPage 2003. You can either save a copy of our practice page: frontpage-practice.htm and open it in FrontPage or you can download and unzip our sample FrontPage web: frontpage-web.zip (requires an unzip program, like WinZip). You can also start with your own blank page and just follow-along as we add our form and form elements.
This tutorial will walk you through how to create a new form and insert all the necessary form elements, so you end up with a contact form that looks similar to this:
We will insert each of the major form elements and insure each element is marked-up for accessibility. You can modify the form later and put it on your own site. Setup Your Design Area.Using "Split" View.As you work, we recommend using the "Split" view in FrontPage, so you can see both the design screen and the HTML code that is being written as you work. Not only does this make it easier to edit your HTML when needed, but this is also a great way to learn HTML -- notice what gets written each time you make changes in the design screen. To change your current view option: on the Show "Forms" Toolbar.You can create forms and insert form elements at any time
using the Insert menu (choose Form). However, most people find it is easier to
work with forms using the Forms toolbar. To turn this toolbar on, go to the The Forms toolbar looks like this: Step 1: Create Your Form.First, you need to create a new form on the page, in which all the form elements will be placed:
When you are done, your HTML should look like this: <form method="POST"
action="process-form.php" name="contact"> Note it is very simple code. In the future, it might be easier to edit the FORM tag directly in the HTML, rather than using the Form Properties window in FrontPage.
Step 2: Add Text Boxes.Text boxes require a unique label and unique ID for each box. Attach the label to the text box by using the "for" attribute in the LABEL tag. The "for" attribute should equal the "id" attribute in the INPUT tag. Add three text boxes to your form:
You can add all your text and text boxes first and then go
back and add labels or add label tags as you design the form -- it doesn't
matter. You can edit your text boxes by right-clicking on the box and choosing
" <p><label
for="fp1">First Name: </label> Example of Text Boxes:
Step 3: Add a Radio Button Group (Option Group).Radio buttons are the most problematic form element for users of assistive technology. In particular, for JAWS users, it can be difficult to engage "Forms Mode" when the cursor is focus on a radio button. In addition, when a group of radio buttons are used to answer a single question, you must use a FIELDSET to associate both the question and answer with each radio button. Finally, users can only turn a radio button on -- not off -- and at least one radio button must be selected in the group, making it very important to offer a "None" or "Does not apply" option. The WAC recommends using radio buttons sparingly and instead choosing a list or drop-down menu. Tips for Using Radio Button Groups:
<fieldset> Insert a radio group:
When you are finished, your HTML should look similar to this: <fieldset> Note that the "name" attribute for each radio button is the same. This insures that only one button can be selected at a time. Yet, each button has a unique "id" value. This ties the unique description (LABEL) to the particular radio button. Also, we have inverted our TABINDEX, so that the cursor will focus on the last option first and move up the list, rather than down. Example of Radio Buttons (inside FIELDSET):
Step 4: Add a Drop-Down Menu.Menus and list boxes are excellent choices for presenting multiple options in one field. They can be limited to accept only one answer or to allow multiple selections. Both FrontPage and Dreamweaver automate much of the work for accessible menus and list boxes. Notice in the example below that each OPTION tag does not require a separate label. Wherever a form element includes a VALUE attribute that is displayed that attribute serves as the label for that form element. Insert a drop-down menu.
Your finished HTML should look similar to this: <p align="left"> Example of Menu Box (with drop-down menu):
A Note About Jump Menus.One very problematic form of the menu/list box -- the Jump Menu. When a user selects an option in a Jump Menu, a script, link, or other action is automatically engaged. Thus, the user only needs to click on the object once. However, keyboard users can only select the first item -- as soon as it is selected by the keyboard, the action is engaged and users cannot scroll down the rest of the list. Instead of a Jump Menu, add a "GO" or "Select" button next to the menu to allow users to initiate the action with an additional click. Note that this option typically relies on JavaScript or other client-side scripting to make the GO button work and should therefore not be used as the primary navigation method (See "Processing Forms" above). The WAC has some examples of good and bad Jump Menus. Step 5: Add a Text Area.Text areas, like text boxes, are also fairly straight forward. In most cases, engaging the "Return" button once inside a text area will create a new line of text and not send the form. But, be sure to test how your server interprets this action. Most problems occur when using client-side processing to validate the form (validates on detection of ENTER key). Insert a text area:
The width setting controls how wide your text box is
displayed. Typically, 50-75 characters is a good range, but you'll need to
test in your browser. You can also increase how many rows of text are
displayed at any given time by changing the " Your HTML should look similar to this: <p><label
for="fp8">Tell us your question:<br></label> Example of Text Area:
Step 6: Add a Check Box Group.In most cases, check boxes are preferable to radio buttons, because users can turn each box on ("checked") or off ("unchecked"). They are particularly useful for a single or series of separate, perhaps unrelated, yes/no questions (e.g. "Are you married?" and "Do you own a pet?"). However, they are still a rather clumsy method of offering multiple choices (e.g. "Which type/s of pet/s do you own?") -- the WAC recommends using the Menu/List box instead. Some designers prefer to use the menu/list for "yes/no/neither" questions as well. Check boxes resemble text boxes in that each box must be given a unique ID and the label tag must be updated for each. Also, FrontPage assigns each check box the value of "ON," which you can change, if desired. Like the radio button, add the FIELDSET and LEGEND tags to connect boxes related to the same form question/topic. Insert a check box group:
When you are done, your HTML should look similar to this: <fieldset> Example of Check Box Group:
Step 7: Add Buttons (Submit and Reset).The like the OPTION in a menu or list, the "value" attribute serves as the label for button elements and should therefore be as simple and clear as possible. In particular, note if engaging the button leads to a "next step" (data verification) in the form process and not to the completion/submission of the data. FrontPage automatically adds both a Submit and Reset button when you add a new form. Some designers do not like to include a reset/clear button, because of the possibility of accidentally erasing inputs (especially with a long form). Another suggestion is to move the reset button farther away from the submit button to help reduce the user's possibility of accidentally clicking on the wrong button. In our example, we've added a bit more space between the two buttons and changed the value attribute to more descriptive text: <p><input
type="submit" value="Submit Your Question"
name="B1"></p> Example of Button:
|
OSU Web Accessibility Center (WAC)
1760
Neil Ave
150
Pomerene Hall
Columbus,
Ohio
43210
Phone: (614) 292-1760
Fax: (614) 292-4190
E-mail: webaccess@osu.edu
For questions or problems with this site, including incompatibility with assistive technology,
email the WAC Webmaster.