HTML

HTML Intro

HTML Intro Quiz

HTML Intro Exercise

HTML Basics

HTML Basic Quiz

HTML Basic Exercise

HTML Advance

HTML Advance Quiz

HTML Advance Exercise

HTML Tags List

HTML Global Attributes

HTML Attributes

FAQs

HTML Form form tag

HTML Forms

 

 

HTML forms are used to collect information from the user. Forms are defined using the form element, with its opening and closing tags.

Use the action attribute to point to a webpage that will load after the user submits the form.

The method attribute specifies the HTTP method (GET or POST) to be used when forms are submitted. When you use GET, the form data will be visible in the page address. Use POST if the form is updating data, or includes sensitive information (passwords). POST offers better security because the submitted data is not visible on the page address. 

To take in user input, you need the corresponding form elements, such as text fields. The input element has many variations, depending on the type attribute. It can be a text, password, checkbox, date, radio, URL, submit, etc.

The placeholder attribute shows text when the input field is empty.

 

Explanation:-

 

Attribute Value Description
accept-charset character_set

Specifies the character encodings that are to be used for the form submission

action URL

Specifies where to send the form-data when a form is submitted

autocomplete on
off
Specifies whether a form should have autocomplete on or off
enctype application/x-www-form-urlencoded
multipart/form-data
text/plain
Specifies how the form-data should be encoded when submitting it to the server (only for method="post")
method get
post
Specifies the HTTP method to use when sending form-data
name text Specifies the name of a form
rel external
help
license
next
nofollow
noopener
noreferrer
opener
prev
search
Specifies the relationship between a linked resource and the current document
target _blank
_self
_parent
_top
Specifies where to display the response that is received after submitting the form

Code Explanation

All Tutorials related to HTML Basics

All Sections related to HTML