Form tag

Preview:

DESCRIPTION

A description about the form tag in HTML is given with full view and cross platform compatibility.

Citation preview

Prepared By Gusani Mayank

HTML 4.01 Form Tag Reference

HTML <form> TagThe <form> tag is used to create an HTML

form for user input.

A form can contain input elements like text fields, checkboxes, radio-buttons, submit buttons and more. A form can also contain select menus, textarea, fieldset, legend, and label elements.

Forms are used to pass data to a server.

Required & Optional Attributes

Standard Attributes

HTML <input> Tag

The <input> tag is used to select user information.

An input field can vary in many ways, depending on the type attribute. An input field can be a text field, a checkbox, a password field, a radio button, a button, and more.

Use the <label> tag to define labels for input elements.

Optional Attributes

Standard Attributes

HTML <textarea> TagThe <textarea> tag defines a multi-line text

input control.A text area can hold an unlimited number of

characters, and the text renders in a fixed-width font (usually Courier).

The size of a textarea can be specified by the cols and rows attributes, or even better; through CSS' height and width properties.

Required & Optional Attributes

Standard Attributes

HTML <button> TagThe <button> tag defines a push button.

Inside a button element you can put content, like text or images. This is the difference between this element and buttons created with the input element.

Always specify the type attribute for the button. The default type for Internet Explorer is "button", while in other browsers (and in the W3C specification) it is "submit".

Continue ..The <button> tag is supported in all major

browsers.

If you use the button element in an HTML form, different browsers will submit different values. Internet Explorer will submit the text between the <button> and </button> tags, while other browsers will submit the content of the value attribute.

Use the input element to create buttons in an HTML form.

Optional & Standard Attributes

HTML <select> Tag

The <select> tag is used to create a select list (drop-down list).

The <option> tags inside the select element define the available options in the list.

Optional & Standard Attributes

HTML <option> Tag

The <option> tag defines an option in a select list.

The option element goes inside the select element.

If you have a long list of options, you can group together related options with the <optgroup> tag.

Optional & Standard Attributes

HTML <optgroup> Tag

The <optgroup> tag is used to group together related options in a select list.

If you have a long list of options, groups of related options are easier to handle for the user.

Attributes

HTML <label> TagThe <label> tag defines a label for an input

element.

The label element does not render as anything special for the user. However, it provides a usability improvement for mouse users, because if the user clicks on the text within the label element, it toggles the control.

The for attribute of the <label> tag should be equal to the id attribute of the related element to bind them together.

Optional & Standard Attributes

HTML <fieldset> TagThe <fieldset> tag is used to logically group

together elements in a form.

The <fieldset> tag draws a box around the related form elements.

The <legend> tag defines a caption for the fieldset element.

Standard Attributes

HTML <legend> TagThe <legend> tag defines a caption for the

fieldset element.

Optional & Standard Attributes

End Of HTML Tour

Recommended