HTML form
HTML Tutorial » HTML Form
What is HTML forms?
An HTML form is used to collect data entered by users. The data entered by users is most often sent to a server for processing.
For example, during user registration, you need to collect information such as: name, email address, username, password, etc. to open accounts on online sales sites, banks, forums, social sites, etc.
Syntax:
....
form elements
....
</form>
The <form> element is a container for different types of input elements like: text fields, radio buttons, checkboxes, submit buttons, etc.
Browser Support HTML form
Element | ![]() Chrome |
![]() IE |
![]() Firefox |
![]() Opera |
![]() Safari |
HTML form | Yes | Yes | Yes | Yes | Yes |
<input> Element
<input> element for a form is the most used tag.
<input> element can be displayed in several ways, depending on the type attribute.
We list a few elements:
ID | Type | Description |
---|---|---|
1 | <input type="text"> | Display a single-line text input field |
2 | <input type="checkbox"> | Display checkbox |
3 | <input type="button"> | Display clickable button |
4 | <input type="submit"> | Display submit button |
5 | <input type="radio"> | Display radio button |
How do you create a form in HTML?
Example of <input type="text"> which defines a single-line input field for an input text.
<!DOCTYPE html>
<html>
<body><h2>Text input fields</h2>
<form>
<label for="user_name">User_name:</label><br>
<input type="text" id="user_name" name="user_name"
value="Nick_boss"><br>
<label for="email">E_mail:</label><br>
<input type="text" id="email" name="email"
value="Nick_boss@ager.com">
</form><p>Note: default width of text input fields
</body>
is maximum 20 characters.</p>
</html>
Related subjects:
HTML form action. How to create?
img link
image size
How to create a form in HTML - Submit Button
Submit Button <input type="submit"> defines a button for submitting the form data in a database.
<!DOCTYPE html>
<html>
<body>
<h2>HTML Forms</h2>
<form action="/submit_dates.php">
<label for="f_name">First name:</label><br>
<input type="text" id="f_name" name="f_name"
value="Nick"><br>
<label for="l_name">Last name:</label><br>
<input type="text" id="l_name" name="l_name"
value="Boss"><br><br>
<input type="submit" value=" Submit ">
</form><p>When you click the "Submit" button, all datas from this
</body>
form will be sent to a page called "/submit_dates.php".</p>
</html>
The form-handler is specified in the <form action> attribute.
HTML Form Controls
There are different types of form controls that you can use to collect data using HTML form −
- Text Input Controls: - First name:
- Checkboxes Controls: - Car
- Radio Box Controls: - HTML
- Select Box Controls
- File Select boxes
- Clickable Buttons
- Hidden Controls
- Submit and Reset Button
html full form form tag in html login form html html form design examples with code, What are HTML forms? How do you create a form in HTML?
HTML form - html tutorial
This tool makes it easy to create, adjust, and experiment with custom colors for the web.

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.

Find here examples of creative and unique website layouts.

Find here examples of creative and unique website CSS HTML menu.