Приглашаем посетить
Бестужев-Марлинский (bestuzhev-marlinskiy.lit-info.ru)

XHTML Forms

Previous Page
Table of Contents
Next Page

XHTML Forms

Forms create an interface for the user to select options, enter information, and return data to the Web server for processing.

<button></button>

Usage

Creates a button.

Start/End Tag

Required/Required.

Attributes

core, i18n, events.

name="name" The button name.

value="value" The value of the button.

type="type" The button type (button, submit, reset).

disabled="disabled" Sets the button state to disabled.

onfocus="eventcode" The event that occurs when the element receives focus.

onblur="eventcode" The event that occurs when the element loses focus.

Empty

No.


<fieldset></fieldset>

Usage

Groups related controls.

Start/End Tag

Required/Required.

Attributes

core, i18n, events.

Empty

No.


<form></form>

Usage

Creates a form that holds controls for user input.

Start/End Tag

Required/Required.

Attributes

core, i18n, events.

action="actionurl" The URL for the server action.

method="post/get" The HTTP method (get, post). get is deprecated.

enctype="mediatype" Specifies the MIME (Internet media) type.

onsubmit="eventcode" The intrinsic event that occurs when the form is submitted.

onreset="eventcode" The intrinsic event that occurs when the form is reset.

accept="contenttypes" The list of content types acceptable by the server.

accept-charset="encodings" The list of character encodings.

Empty

No.


<input />

Usage

Defines controls used in forms.

Start/End Tag

Required/Illegal.

Attributes

core, i18n, events.

type="controltype" The type of input control (text, password, checkbox, radio, submit, reset, file, hidden, image, button).

name="name" The name of the control (required except for submit and reset).

value="value" The initial value of the control (required for radio and check boxes).

checked="checked" Sets the radio buttons to a checked state.

disabled="disabled" Disables the control.

readonly="readonly" For text password types.

size="size" The width of the control in pixels except for text and password controls, which are specified in number of characters.

maxlength="maxlength" The maximum number of characters that can be entered.

src="imageurl" The URL to an image control type.

alt="alttext" An alternative text description.

usemap="mapurl" The URL to a client-side imagemap.

onfocus="eventcode" The event that occurs when the element receives focus.

onblur="eventcode" The event that occurs when the element loses focus.

onselect="eventcode" An intrinsic event that occurs when the control is selected.

onchange="eventcode" An intrinsic event that occurs when the control is changed.

accept="filetypes" File types allowed for upload.

Empty

Yes.


<label></label>

Usage

Labels a control.

Start/End Tag

Required/Required.

Attributes

core, i18n, events.

for="control" Associates a label with an identified control.

onfocus="eventcode" The event that occurs when the element receives focus.

onblur="eventcode" The event that occurs when the element loses focus.

Empty

No.


<legend></legend>

Usage

Assigns a caption to a fieldset.

Start/End Tag

Required/Required.

Attributes

core, i18n, events.

Empty

No.


<optgroup></optgroup>

Usage

Used to group form elements within a <select> element.

Start/End Tag

Required/Required.

Attributes

core, i18n, events.

disabled="disabled" Not used.

label="label" Defines a group label.

Empty

No.


<option></option>

Usage

Specifies choices in a <select> element.

Start/End Tag

Required/Optional.

Attributes

core, i18n, events.

selected="selected" Specifies whether the option is selected.

disabled="disabled" Disables control.

label="label" Defines a label for the group of options.

value="value" The value submitted if a control is submitted.

Empty

No.


<select></select>

Usage

Creates choices for the user to select.

Start/End Tag

Required/Required.

Attributes

core, i18n, events.

name="name" The name of the element.

size="size" The width in number of rows.

multiple="multiple" Allows multiple selections.

disabled="disabled" Disables the control.

onfocus="eventcode" The event that occurs when the element receives focus.

onblur="eventcode" The event that occurs when the element loses focus.

onselect="eventcode" An intrinsic event that occurs when the control is selected.

onchange="eventcode" An intrinsic event that occurs when the control is changed.

Empty

No.


<textarea></textarea>

Usage

Creates an area for user input with multiple lines.

Start/End Tag

Required/Required.

Attributes

core, i18n, events.

name="name" The name of the control.

rows="numrows" The width in number of rows.

cols="numcols" The height in number of columns.

disabled="disabled" Disables the control.

readonly="readonly" Sets the displayed text to read-only status.

onfocus="eventcode" The event that occurs when the element receives focus.

onblur="eventcode" The event that occurs when the element loses focus.

onselect="eventcode" An intrinsic event that occurs when the control is selected.

onchange="eventcode" An intrinsic event that occurs when the control is changed.

Empty

No.

Notes

Text to be displayed is placed within the start and end tags.



Previous Page
Table of Contents
Next Page