HTML Form :You Must Know In 2021

Illustration of three people working together with a large clipboard and oversized pencil, surrounded by check marks and a "Get started" button. The background has a wave-like orange shape at the top with navigation links: Home, About, Services, Contact, and a Sign up button.


HTML form is a section of a document which contains controls such as text fields, password fields, check boxes, radio buttons, submit button, menus etc.

An HTML form facilitates the user to enter data that is to be sent to the server for processing such as name, email address, password, phone number, etc. 

Why use HTML Form

HTML forms are required if you want to collect some data from of the site visitor.

For example: If a user want to purchase some items on internet, he/she must fill the form such as shipping address and credit/debit card details so that item can be sent to the given address.

HTML Form Controls

There are different types of form controls that you can use to collect data using HTML form −

  • Text Input Controls
  • Checkboxes Controls
  • Radio Box Controls
  • Select Box Controls
  • File Select boxes
  • Hidden Controls
  • Clickable Buttons
  • Submit and Reset Button

Hidden Form Controls

Hidden form controls are used to hide data inside the page which later on can be pushed to the server. This control hides inside the code and does not appear on the actual page. For example, following hidden form is being used to keep current page number. When a user will click next page then the value of hidden control will be sent to the web server and there it will decide which page will be displayed next based on the passed current page.

Form Attributes

Apart from common attributes, following is a list of the most frequently used form attributes −

Sr.NoAttribute & Description
1actionBackend script ready to process your passed data.
2methodMethod to be used to upload data. The most frequently used are GET and POST methods.
3targetSpecify the target window or frame where the result of the script will be displayed. It takes values like _blank, _self, _parent etc.
4enctypeYou can use the enctype attribute to specify how the browser encodes the data before it sends it to the server. Possible values are −application/x-www-form-urlencoded − This is the standard method most forms use in simple scenarios.mutlipart/form-data − This is used when you want to upload binary data in the form of files like image, word file etc.

Read also: HTML Tags Tutorial : You Must Know In 2021

Eram Naim, with 4 years of experience in content marketing and 2 years in digital marketing, currently serves as the Co-Founder and COO of In addition to his role as COO, he also functions as the Sales & Marketing Manager and Editor, showcasing his versatility and expertise across multiple domains within the company.