coding180 icon

Coding180

HTML Form - <form>

HTML Form - <form>

Tutorials > HTML > HTML Form Elements


Html form is an element that we use to collect data (inputs) from a webpage and submit it to the server. 

Form has a child element called input. <input> is used to collect different types of data in a form. The type of data to collect is specified using the type attribute of the input element.

HTML form syntax: 

<form>
<input>
</form>

Form has a child element called input. <input> is used to collect different types of data in a form. The type of data to collect is specified using the type attribute of the input element.

HTML Form Attributes

Forms has special attributes that can control its behavior. 

  • Action - Specify where we are sending form data to. 
  • EncType: Used to inform the browser to send our file upload in multiple parts. This attribute is used alongside with file upload input field. 
  • Method. This specify how our input data is going to be transferred.  We have POST and GET Method. 
    • GET will append the input data in the url. 
    • POST will include the data in our http request. This is typically useful when sending data to the server.

 

Html form label.

Label is just a name we use to tell the user the type of input we expect in a particular field.

This is important for the browser, users and screen readers.


user

Robort Gabriel

Lagos, Nigeria

Freelance Web Developer, Native Android Developer, and Coding Tutor.

Skills
  • UI / UX
  • JavaScript
  • Python
  • PHP
  • Kotlin
  • Java
  • Bootrap
  • Android
  • Laravel