AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL

HTML form


<< Previous Page
HTML tutorial
Next Page >>
HTML tutorial

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>
....
form elements
....
</form>

The <form> element is a container for different types of input elements like: text fields, radio buttons, checkboxes, submit buttons, etc.

Example of HTML Form





Note: Default Form width of an input field is 20 characters

Browser Support HTML form

Element chrome browser
 Chrome
ie browser
 IE
firefox browser
 Firefox
opera browser
 Opera
safari browser
 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.

Example (this is HTML - PHP editor, change text on this window)
<!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="[email protected]">
</form>

<p>Note: default width of text input fields
is maximum 20 characters.</p>

</body>
</html>
Note: default width of text input fields is maximum 20 characters.

 

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.

Example (this is HTML - PHP editor, change text on this window)
<!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
form will be sent to a page called "/submit_dates.php".</p>

</body>
</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 −

 



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

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


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


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


HTML Img Background
HTML Image Link
HTML Image Size
HTML Text Style
HTML Text Align
HTML Text Size
HTML Text Color Style
HTML Text Color
HTML Table Color
HTML Table Row Colspan
HTML Table Width
HTML Table Style
HTML Table Border
HTML Table
HTML Font Face
HTML Font Size
HTML Font Color
HTML Headings
HTML div border color
HTML div class
HTML class container
HTML form action
HTML comment
HTML link new tab
HTML link underline
HTML link tag
HTML button action
HTML button onclick
HTML button link
HTML table style
HTML image
HTML colors
HTML div style
Text, paragraf in HTML
HTML Tags Attributes
HTML - Elements
HTML Introduction
Home HTML Tutorial
Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


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


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


jQuery replace...
jQuery replaceClass...
jQuery click ()...
jQuery switchClass()...
jQuery draggable()...
jQuery HTML...
jQuery scroll smooth...
jQuery scroll()...
jQuery stop()...
jQuery animate()...
jQuery SlideToggle()...
jQuery slideDown()...
jQuery slideUp()...
jQuery fadeToggle...
jQuery fadeOut()...
jQuery fadeIn()...
jQuery Effects - hide () and show ()...
jQuery Events...
jQuery Attributes...
jQuery Selectors...