HTML Tutorial | Forms


HTML forms are used to collect inputs or data from users.

  • HTML form elements come inside <form> </foam> tag.
  • HTML form contains input elements, textarea , buttons, select options etc.

HTML Input element | Text Input

  • Text input is used to collect text from user.
  • <input type="text"> tag used to collect input information in text from user.
  • HTML name attribute specifies the name or identity of an. <input> element.
  • HTML value attribute specifies the initial value for an input field.
Example:
   <form>
   <input type="text"> name="firstname">
   </foam>
	   

HTML Input element | Password Input

  • HTML Password input is used to collect passwords from user.
  • <input type="password"> tag is used to collect password from user.
Example:
   <form>
   <input type="password"> name="password field">
   </foam>
	   

HTML Input element | Radio Button

  • HTML Radio button is used to collect one choice from number of limited choices from user.
  • <input type="radio"> tag is used to collect a choice from user.
Example:
   <form>
   <input type="radio"> value="male">
   <input type="radio"> value="female">
   <input type="radio"> value="other">
   </foam>
	   

HTML Input element | Checkbox Input

  • HTML Checkbox input is used to collect zero or more choices from number of limited choices from user.
  • <input type="checkbox"> tag is used to collect choices from user.
Example:
   <form>
   <input type="checkbox"> value="Blue Car">
   <input type="checkbox"> value="Red Car">
   <input type="checkbox"> value="Black Car">
   </foam>
	   

HTML Input element | Button Input

  • HTML Button input is used to generate clickable event ( generally use in javascript).
  • <input type="button"> tag is used to define a button on HTML web page.
Example:
   <form>
   <input type="button"> value="Click Me!">
   </foam>
	   

HTML Input element | Submit Button

  • HTML Submit button is used to send all the input data to the server through form handler.
  • The form-handler is typically a server page with a script for processing input data.
  • <input type="submit"> tag is used to send all input information to the server.
  • HTML action attribute specifies the url of form handler page for processing input data.
Example:
   <form action="contact.php">
   <input type="text"> name="firstname">
   <input type="password"> name="password field">
   <input type="submit"> value="Submit">
   </foam>
	   

HTML Input element | Textarea

  • HTML Textarea is used to collect multi-line texts from user.
  • <textarea> tag is used to collect multi-line text from user.
  • We can set the default or initial size of textarea by cols and rows attributes.
Example:
   <form>
   <textarea name="message" rows="10" cols="30">
   </foam>
	   

HTML Input element | Select Option

  • HTML Select option is used to collect one selected option from many available options from user.
  • <select> tag is used to provide drop-down list of options to the user.
  • Every option comes inside <option> </option> tag
  • The list will normally shows the first item as selected.
Example:
   <form>
   <select name="car">
   <option>Audi</option>
   <option>Lamborghini</option>
   <option>Ferrari</option>
   </select>
   </foam>
	   


Video-English
Best Use:360p or more (480p or 720p)



Video-Hindi
Best Use:360p or more (480p or 720p)