HTML Forms

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

In order to group input elements and submit data, HTML uses a form element to encapsulate input and submission elements. These forms handle sending the data in the specified method to a page handled by a server or handler. This topic explains and demonstrates the usage of HTML forms in collecting and submitting input data.

Syntax

  • <form method="post|get" action="somePage.php" target="_blank|_self|_parent|_top|framename">

Parameters

Attribute                  Description
accept-charsetSpecifies the character encodings that are to be used for the form submission.
actionSpecifies where to send the form-data when a form is submitted.
autocompleteSpecifies whether a form should have autocomplete on or off.
enctypeSpecifies how the form-data should be encoded when submitting it to the server (only for method="post").
methodSpecifies the HTTP method to use when sending form-data (POST or GET).
nameSpecifies the name of a form.
novalidateSpecifies that the form should not be validated when submitted.
targetSpecifies where to display the response that is received after submitting the form.

Remarks

The <form> element represents a section that contains form-associated elements (e.g. <button> <fieldset> <input> <label> <output> <select> <textarea>) that submits information to a server. Both starting (<form>) and ending (</form>) tags are required.



Got any HTML Question?