27
Prepared By Gusani Mayank

Form tag

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Form tag

Prepared By Gusani Mayank

Page 2: Form tag

HTML 4.01 Form Tag Reference

Page 3: Form tag

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.

Page 4: Form tag

Required & Optional Attributes

Page 5: Form tag

Standard Attributes

Page 6: Form tag

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.

Page 7: Form tag

Optional Attributes

Page 8: Form tag

Standard Attributes

Page 9: Form tag

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.

Page 10: Form tag

Required & Optional Attributes

Page 11: Form tag

Standard Attributes

Page 12: Form tag

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".

Page 13: Form tag

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.

Page 14: Form tag

Optional & Standard Attributes

Page 15: Form tag

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.

Page 16: Form tag

Optional & Standard Attributes

Page 17: Form tag

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.

Page 18: Form tag

Optional & Standard Attributes

Page 19: Form tag

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.

Page 20: Form tag

Attributes

Page 21: Form tag

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.

Page 22: Form tag

Optional & Standard Attributes

Page 23: Form tag

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.

Page 24: Form tag

Standard Attributes

Page 25: Form tag

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

fieldset element.

Page 26: Form tag

Optional & Standard Attributes

Page 27: Form tag

End Of HTML Tour