HTML Tags Web development basics

HTML form – using basics

A simple HTML form

First name:

Last name:


The <form> element

This element defines the form used in a web page to collect user input.It is used as below:

Let us see all the elements one by one,

  • The <input> element -The <input> elements can be of different types depending upon the type attribute.The various types are
  • Action attributes-The action attribute defines the action to be performed when the form is submitted.It is used as
  • Method attribute-The method attribute specifies the HTTP method (GET or POST) to be used when submitting the form data

    The GET method-The GET method id the default method for submitting a form.Bu using GET method the data submitted over the form is visible in the address file like,

    The POST method-POST method is used whenever more sensitive and important information is submitted in a from. The information can be passwords or account numbers.The information sent using POST is not visible in the address bar.Large amounts of data can be sent over POST.It has no size limitations.
  • The name attribute-Each input field must have a name attribute to be submitted.If the name attribute is omitted, the data of that input field will not be sent at all.