HTML5 Forms- Tutorial and Instructions
About HTML5 Forms: Overview
HTML5 forms are used to collect information from people who visit your website. For example, you can use HTML5 forms to find out details about your visitors through surveys and feedback, or engage in e-commerce by selling your goods and services to people.
HTML5 forms are defined by the <form>…</form> tags and are made up of different elements used to collect data, such as text boxes and radio buttons. After a user inputs all of the form information, they submit the HTML5 form by using the “Submit” button you create within the form. What then happens with the data is a decision you will need to make. You can use a CGI script to manage the data, send the data to a database, or even receive the data via e-mail.
To begin creating an HTML5 form that uses a CGI script, start with the <form> tag, containing the command (method=“post”) and the ACTION attribute, with a value equal to the path and name of your CGI script.
|Attributes:||method=“post” action=“?”||Where “?” is the path and name of your CGI script for the form.|
|Example:||<form method=“post” action=“/cgi-bin/contact.pl”>|
|Result:||Creates the structure of the form.|
About HTML5 Forms: Instructions
- To create an HTML5 form that uses a CGI script, type the first part of the start tag at the point in the HTML5 web page where you want to insert the form: <form
- Type a space and then the attributes: method=“post” action=“?”
(where “?” is the path and name of you CGI script for the form.)
- Close the tag by typing: >
- On the next line, type the end tag: </form>
About HTML5 Forms: Video Lesson
The following video lesson, titled “11.1- About Forms,” shows how to create an HTML5 form. This video lesson is from our complete HTML5 tutorial, titled “Mastering HTML5 and CSS3 Made Easy v.1.0,” which you can see in the picture that follows the video.