HTML Page Structure

HTML Elements
HTML Attributes


HTML Form Tag

If you want to make your website interactive or collect user's responses and inputs, you need to use <form> tag. HTML form tag <form> and </form> is used to create a form on the web page.

JavaScript, CGI or PHP is used to write scripts for making form interactive in order to collect inputs from the users, maintain user inputs data received through your web page.

You can place the form tag anywhere inside the Body of an HTML document. Text boxes, Radio buttons, Check boxes, Drop down list and Other input fields are used to create a form.

Basic attributes to a form are Action, Method and Enctype. Action attribute refers to the URL to which the form submission is sent which is usually be a server side script written in PHP or Pearl. Method attribute referes to the method of sending data to the Action URL. Method will be either "get" or "post". "Get" is suited for small forms and it is a default method whereas "Post" is used for comparatively larger forms. Enctype attribute refers to the format of the data submitted to the server.

Syntax

Example

This will produce following result

Name:

Please rate hotel service from 1 to 3 (1 = worst and 3= excellent):