The Filter API can be used to attempt to automatically fill-in HTML forms before they are sent to the web browser. HTML forms are defined with HTML tags that specify the type of the form field along with a name used by the web server to obtain the data entered by the user. An example HTML form is shown in Figure 5.5.
When a user enters their name, address, and phone number in this example form, the web browser will send data to the web server where the field values can be obtained using their corresponding field names. The names of form fields can be any arbitrary text string. The example form shown could have named the fields FIELD1, FIELD2, and FIELD3. However, most HTML forms use descriptive field names to make it easier for HTML authors to create HTML forms and at the same time make it easier for programs that process form data to obtain field values. This use of descriptive names in forms makes it possible for a ContentFilter to scan HTML form tags for specific field names and automatically fill-in default values.