The Mailtool: Writing the Tool's UI - Doc JavaScript

The Mailtool

Writing the Tool's UI

The mailto: URL tool includes two parts. The HTML part defines the form itself. The form includes basic input elements such as text fields, text areas, and buttons. The important attribute of these input fields is NAME. All references to values of these fields are done through their NAME attribute. If the form name is mailtoForm, and the input field's name is NAME="subject", then the field value is:

mailtoForm.subject.value

You can also set a field by assigning a value to mailtoForm.subject.value. Buttons are assigned with the following event handlers that are covered later in this column: createMailto(), testMailto(), and viewMailto(). Notice the TYPE="Reset" button. It clears all form's fields without explicitly specifying the event handler. A field's VALUE determines the text that appears on the button. The SIZE attribute determines the field's length in characters. The COLSPAN attribute specifies how many columns a table cell spans (one, if attribute is not specified). Here is the HTML code. It is self explanatory for the most part: