XHTML Reference


go to previous section go to next section 

Forms

 

Defining a Form

Each form definition must be enclosed within <form action=""> </form> tags.

A form can be divided into sections using the <fieldset> </fieldset> tags. If broken into sections then each section should have a title contained within <legend> </legend> tags.

The following optional attributes can be specified on a <form> tag:

The following attributes are deprecated but can still be used with the transitional DOCTYPE

A <form> tag may not be nested within another <form> tag.

The following optional attributes can be specified on a <fieldset> tag:

The following optional attributes can be specified on a <legend> tag:

The following attributes are deprecated but can still be used with the transitional DOCTYPE

go to top

 

Input Fields

The <label> </label> identify text associated with a form field as being a label for that field.

The following optional attributes can be specified on a <label> tag:

A <label> tag may not be nested within another <label> tag.

Most input fields are defined using the <input /> tag. One exception is the text box (which allows multiple lines of text to be input). This is defined using <textarea rows="" cols=""> </textarea> tags

The following optional attributes can be specified on a <input> tag:

The following attributes are deprecated but can still be used with the transitional DOCTYPE

The following optional attributes can be specified on the <textarea> tag:

go to top

 

Buttons and Selection Lists

Push buttons can now be defined using <button> </button> tags.

The following optional attributes can be specified on the <button> tag:

A <button> tag may not be have another <button> tag, <a> tag, <input> tag, <select> tag, <textarea> tag, <label> tag, <form> tag, or <fieldset> tag nested within it.

Selection lists can be created using the <select> </select> tags. Each entry within the selection list needs to be defined within <option> </option> tags.

The following optional attributes can be specified on the <select> tag:

The following optional attributes can be specified on the <option> tag:

It is now possible to group items within a selection list using <optgroup label="" > </optgroup> tags.

The following optional attributes can be specified on the <optgroup> tag:

 

go to previous section go to next section 

 

This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow
Donate