Thursday 19 February 2015

Form Tag Input Types

Every Web form is composed of multiple HTML input tags.


Any form on a Web page is composed of multiple HTML tags surrounded by and tags. Every part of a form, such as a new field or a submit button, has its own tag with multiple attributes, including the "type" attribute. Specifying the type of an tag tells the Web browser display the field. There are 10 valid "type" options for an tag.


Basic Format


The basic format of an tag is:


Replace "typeoption" with one of the valid input field options.


Button


The "button" type creates a button that your website visitors can click. This type is not for a form's "submit" button but rather for activating JavaScript or loading external links. For example:


Check box


The "checkbox" type creates one check box. All check boxes in the same question have the same "name" attribute. For example:


Pineapple


Orange


File


The "file" type tells the Web browser to provide a "Browse" button for a website visitor to locate a file on his computer to upload as part of the form. This normally takes the form:


Hidden


Specifying the input type as "hidden" hides the field but still passes that field's value in the form submission. For example, you could pass a hidden field that specifies from which page on your website a visitor submits a form:


Image


Using the "image" type creates a submit button for your form out of an image, instead of displaying the default Web button. For example:


Password


The "password" input type creates a standard blank text box, but obscures whatever letters and numbers the visitors enters as a security measure. For example:


Radio


The "radio" type creates a small circle next to each option. Radio buttons are similar to check boxes, except visitor can select only one answer for each radio question, while they could select multiple check boxes. An example of radio button code:


Honda


Ford


Submit and Reset


The "submit" input type submits a form's contents, while the "reset" input type clears all current form entries. For example:


Text


Specify an input type as "text" for a blank text box that displays entered characters normally. Specify the width of a text field with the "size" attribute. For example:

Tags: input type, type creates, check boxes, submit button, attribute example, blank text, composed multiple