HTML and CSS Reference
In-Depth Information
Exploring the Other Input Types
HTML5 introduces several other input types. To demonstrate them, you'll add a feedback form with some rather
contrived questions. These will implement the other types that are available to you.
■
To get a detailed explanation of each of the input elements, check out the actual HTmL5 specification. This
address will take you to the section on input elements:
http://www.whatwg.org/specs/web-apps/current-
Tip
Implementing a Feedback Form
In the next exercise, you'll create a new form and add several input controls; one of each type. After you have
created the form I'll discuss each of the controls.
eXerCISe 2-2. aDDING a FeeDBaCK FOrM
open the
Chapter
2
project in Visual Studio if not already open.
1.
In the Solution Explorer, right-click the
Chapter
2
project and select the Add
Webform links. Enter
Feedback
when prompted for the form name.
2.
This will create a new form with a single
div
as shown in Listing 2-1.
3.
Listing 2-1.
The blank form implementation
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Feedback.aspx.cs"
Inherits="Chapter
2
.Feedback" %>
<!DOCTYPE html>
<html xmlns="
http://www.w3.org/1999/xhtml
"
>
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
Within the empty
div
, enter the code shown in Listing 2-2. This will add several
fields that each demonstrate one of the new input types.
4.