Webmaster

you are here: Lycos Home » Lycos Webmaster » References » HTML 4.0 » Forms
References : HTML 4.0

 | Index | 
 | Structure | Text paragraphs and phrases | Text formatting | Lists | Links | Tables | Frames | Embedded content | Style | Forms | Scripts | 
 | All tags | 

Forms

Forms provide users with an interface for selecting options and submitting data back to the Web server.

<button> | <fieldset> | <form> | <input> | <isindex> | <label> | <legend> | <option> | <select> | <textarea>

<button>...</button>
Creates a button.
 
Starting/ending tag Required/Required
 
Attributes Attributes %coreattrs, %i18n, %events
name="...": Button name.
value="...": Button value.
type="...": Button type (button, submit, reset).
disabled="...": Sets the button state to disabled.
tabindex="...": Defines the tabbing sequence between elements with a tabindex.
onfocus="...": Event that occurs when the element receives focus.
onblur="...": Event that occurs when the element loses focus.
 
Empty No
 
Example<form>
<button name="submit" type="submit">OK</button>
</form>
 
 Top
<fieldset>...</fieldset>
Group controls
 
Starting/ending tag Required/Required
 
Attributes Attributes %coreattrs, %i18n, %events
 
Empty No
 
Example<form>
<fieldset width="250">
<legend>Which town do you come from?</legend>
<input type="radio" value="Paris">Paris<br>
<input type="radio" value="Lyon">Lyon<br>
</fieldset>
</form>
 
 Top
<form>...</form>
Creates a form containing controls for saving user input.
 
Starting/ending tag Required/Required
 
Attributes Attributes %coreattrs, %i18n, %events
action="...": URL to server action.
enctype="...": MIME type (Internet media type).
onsubmit="...": Intrinsic event that occurs when the form is submitted.
onreset="...": Intrinsic event that occurs when the form is reset.
target="...": determines where the resource will be displayed (user-defined name, _blank, _parent, _self, or _top).
accept-charset="...": list of character encodings.
method="...": HTTP method.
 
Empty No
 
Example<form method=GET action="/cgi-bin/mailer">
</form>
 
 Top
<input>
Defines the controls used in forms
 
Starting/ending tag Required/Illegal
 
Attributes Attributes %coreattrs, %i18n, %events
type="...": Input control type (text, password, checkbox, radio, submit, reset, file, hidden, image, button).
name="...": Control name (required except for submit and reset).
value="...": Control initial value (required for radio buttons and checkboxes).
checked="...": Sets radio buttons to checked state.
disabled="...": Disables controls.
readonly="...": For password types.
size="...": Control width in pixels, except for password and text controls which are specified in number of characters.
maxlength="...": Maximum number of characters that can be entered.
src="...": Image control type URL.
alt="...": An alternative text description.
usemap="...": Client-side imagemap URL.
tabindex="...": Defines the tabbing order between elements with a tabindex.
onfocus="...": Event that occurs when the element receives focus.
onblur="...": Event that occurs when the element loses focus.
onselect="...": Intrinsic event that occurs when the control is selected.
onchange="...": Intrinsic event that occurs when the control is changed.
accept="...": File types allowed for download.
 
Deprecated Deprecated align="...": Controls alignment (left, center, right, justify).
 
Empty Yes
 
Notes In XHTML 1.0, this tag should be in the form <input /> to ensure compatibility with older browsers.
 
Example<form>
<input type="text" name="login" size="20">
</form>
 
 Top
<isindex>
Prompts the user for input.
 
Starting/ending tag Required/Illegal
 
Attributes Attributes %coreattrs, %i18n
 
Deprecated Deprecated prompt="...": Sets a prompt string for the input field.
 
Empty Yes
 
Notes In XHTML 1.0, this tag should be in the form <index /> to ensure compatibility with older browsers.
 
 Top
<label>...</label>
Assigns a label to a control.
 
Starting/ending tag Required/Required
 
Attributes Attributes %coreattrs, %i18n, %events
for="...": Associates a label with an identified control.
disabled="...": Disables a control.
accesskey="...": Assigns a hotkey to this element.
onfocus="...": Event that occurs when the element receives focus.
onblur="...": Event that occurs when the element loses focus .
 
Empty No
 
Example<label for="champs">Fill in this form field</label>
 
 Top
<legend>...</legend>
Assigns a caption to a group of form components ( fieldset).
 
Starting/ending tag Required/Required
 
Attributes Attributes %coreattrs, %i18n, %events
accesskey="...": Assigns a hotkey to this element.
 
Deprecated Deprecated align="...": Controls alignment (left, center, right, justify).
 
Empty No
 
Example<form>
<fieldset width="250">
<legend>Which town do you come from?</legend>
<input type="radio" value="Paris">Paris<br>
<input type="radio" value="Lyon">Lyon<br>
</fieldset>
</form>
 
 Top
<option>...</option>
Specifies choices in a select element.
 
Starting/ending tag Required/Optional (HTML)
Required/Required (XHTML 1.0).
 
Attributes Attributes %coreattrs, %i18n, %events
selected="...": Indicates whether the option is selected.
disabled="...": Disables the control.
value="...": Value submitted if a control is submitted.
 
Empty No
 
Example<form>
<select name="department">
<optionvalue="01">Ain
<option value="02">Aisne
<option value="03">Allier
<option value="04">Alpes de Haute Provence
</select>
</form>
 
 Top
<select>...</select>
Creates choices for the user to select.
 
Starting/ending tag Required/Optional (HTML)
Required/Required (XHTML 1.0).
 
Attributes Attributes %coreattrs, %i18n, %events
name="...": Element name.
size="...": Control width in pixels, except for password and text controls that are specified in number of characters..
multiple="...": Authorizes several selections.
disabled="...": Disables the control.
tabindex="...": Defines the tabbing sequence between elements with a tabindex.
onfocus="...": Event that occurs when the element receives focus.
onblur="...": Event that occurs when the element loses focus.
onselect="...": Event that occurs when the element is selected.
onchange="...": Event that occurs when the control is changed.
 
Empty No
 
Example<form>
<select name="department">
<optionvalue="01">Ain
<option value="02">Aisne
<option value="03">Allier
<option value="04">Alpes de Haute Provence
</select>
</form>
 
 Top
<textarea>...</textarea>
Creates an area with multiple lines for user input.
 
Starting/ending tag Required/Required
 
Attributes Attributes %coreattrs, %i18n, %events
name="...": Element name.
size="...": Control width in pixels, except for password and text controls that are specified in number of characters.
rows="...": Height in number of rows.
cols="...": Width in number of columns.
disabled="...": Disables the control.
readonly="...": Sets the displayed text to read-only state.
tabindex="...": Defines the tabbing sequence between elements with a tabindex.
onfocus="...": Event that occurs when the element receives focus.
onblur="...": Event that occurs when the element loses focus.
onselect="...": Event that occurs when the element is selected.
onchange="...": Event that occurs when the control is changed.
 
Empty No
 
Notes The text to be displayed is enclosed between the start and end tags.
 
Example<form>
<textarea name="comment" rows="20" cols="80">Enter your comment here</textarea>
</form>
 
 Top

 | Index | 
 | Structure | Text paragraphs and phrases | Text formatting | Lists | Links | Tables | Frames | Embedded content | Style | Forms | Scripts | 
 | All tags |