HTML Form

HTML Form used to capture data. Html forms is one of the main points of conversation between a user and a website or application. They allow users to send data to the website. Most of the time data sent to the web server, but the web page can also block it for self use.

The <form> tag used to create HTML forms, there are different tags and attributes available in the HTML for the number of boxes in the HTML forms.

HTML Form Example

<!DOCTYPE html>
<html>
<body>

<h2>HTML Forms</h2>

<form action=" ">
  First name:<br>
  <input type="text" name="firstname" value="Tutorials">
  <br>
  Last name:<br>
  <input type="text" name="lastname" value="Track">
  <br><br>
  <input type="submit" value="Submit">
</form> 

</body>
</html>

Output

HTML Forms

First name:

Last name:


HTML input type

<Input> Tag is the most important form element. Or we can say that <input> tag is the most used in any form. By placing different attributes in the <input> tag, we can create many types of designs in a form.

  • input type = “text” is use to write a word or word.
  • input type = “password” is use to write the password. Because we do not see what we write in input type = “password”.
  • input type = “radio” is use to create a radio button in the form.
  • input type = “image” is use to create graphical submit buttons.
  • input type = “email” is use for email ID.
  • input type = “number” is use for a number like 1, 2, 3, … 452558 etc.
  • input type = “file” is use to upload any file like Image or a ZIP file.
  • input type = “submit” is use to submit all data to the input field and send it to the web server.