![]() Back to www.deitel.com |
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
4 <!-- Fig. 26.13: form.html -->
|
5 <!-- Form for use with the form.php program -->
|
6
|
7 <html xmlns = "http://www.w3.org/1999/xhtml">
|
8 <head>
|
9 <title>Sample form to take user input in XHTML</title>
|
10 </head>
|
11
|
12 <body>
|
13
|
14 <h1>This is a sample registration form.</h1>
|
15 Please fill in all fields and click Register.
|
16
|
17 <!-- post form data to form.php -->
|
18 <form method = "post" action = "form.php">
|
19 <img src = "images/user.gif" alt = "User" /><br />
|
20 <span style = "color: blue">
|
21 Please fill out the fields below.<br />
|
22 </span>
|
23
|
24 <!-- create four text boxes for user input -->
|
25 <img src = "images/fname.gif" alt = "First Name" />
|
26 <input type = "text" name = "fname" /><br />
|
27
|
28 <img src = "images/lname.gif" alt = "Last Name" />
|
29 <input type = "text" name = "lname" /><br />
|
30
|
31 <img src = "images/email.gif" alt = "Email" />
|
32 <input type = "text" name = "email" /><br />
|
33
|
34 <img src = "images/phone.gif" alt = "Phone" />
|
35 <input type = "text" name = "phone" /><br />
|
36
|
37 <span style = "font-size: 10pt">
|
38 Must be in the form (555)555-5555</span>
|
39 <br /><br />
|
40
|
41 <img src = "images/downloads.gif"
|
42 alt = "Publications" /><br />
|
43
|
44 <span style = "color: blue">
|
45 Which book would you like information about?
|
46 </span><br />
|
47
|
48 <!-- create drop-down list containing book names -->
|
49 <select name = "book">
|
50 <option>Internet and WWW How to Program 3e</option>
|
51 <option>C++ How to Program 4e</option>
|
52 <option>Java How to Program 5e</option>
|
53 <option>XML How to Program 1e</option>
|
54 </select>
|
55 <br /><br />
|
56
|
57 <img src = "images/os.gif" alt = "Operating System" />
|
58 <br /><span style = "color: blue">
|
59 Which operating system are you currently using?
|
60 <br /></span>
|
61
|
62 <!-- create five radio buttons -->
|
63 <input type = "radio" name = "os" value = "Windows XP"
|
64 checked = "checked" />
|
65 Windows XP
|
66
|
67 <input type = "radio" name = "os" value =
|
68 "Windows 2000" />
|
69 Windows 2000
|
70
|
71 <input type = "radio" name = "os" value =
|
72 "Windows 98" />
|
73 Windows 98<br />
|
74
|
75 <input type = "radio" name = "os" value = "Linux" />
|
76 Linux
|
77
|
78 <input type = "radio" name = "os" value = "Other" />
|
79 Other<br />
|
80
|
81 <!-- create a submit button -->
|
82 <input type = "submit" value = "Register" />
|
83 </form>
|
84
|
85 </body>
|
86 </html>
|