Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

10.4 Include default, place-holding characters in edit boxes and text areas

Some browsers (screen readers or mobile devices) don't recognise empty form controls; they don't tell you that the control is there or allow you to enter data. This makes it impossible to fill out forms.

To get round this problem, provide some helpful default text to force the browser to read the control. For example, edit boxes and text areas that you use to enter text information such as postal details, phone numbers, etc. should include default characters. Drop-down menus and scrolling lists should include default information as the first option on the list. Radio buttons should have an option selected.

You should enter the default text for <textarea> controls between the opening and closing tags. For example:

<textarea name="name" rows="20" cols="80">Please enter your name.</textarea>

If you use <select> controls (drop-down lists and list boxes), make one of the options active with a selected attribute. For example:

<select name="department">
<option value="1" selected>Accounting</option>
<option value="2">Aanagement</option>
</select>

If you use radio button groups, select an option with the checked attribute of the appropriate radio button. For example:

<input type="radio" name="salary-type" value="exempt">Exempt
<input type="radio" name="salary-type" value="non-exempt" checked>Non-Exempt