Building an HTML Page with a Form

Author Topic: Building an HTML Page with a Form  (Read 1203 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 158
  • Karma: 0
    • We Helpline
Building an HTML Page with a Form
« on: 01-14-2016, 02:19:34 »
Forms are very useful when you want to get information from the user. To illustrate how this is done, look at the whatsName.html code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html lang="EN" dir="ltr" xmlns="">
<title>What's your name?</title>
<link rel = "stylesheet"
type = "text/css"
href = "whatsName.css" />
<h1>What's your name?</h1>
<h3>Writing a form for user input</h3>
<form method = "get"
action = "hiUser.php">
Please type your name:
<input type = "text"
name = "userName"
value = "" />
<input type = "submit" />

If you’re familiar with XHTML forms, there is only one element of this page that may not be familiar to you. Take a careful look at the form tag. It contains two new attributes. action is one of those attributes. The other, method, indicates how the data is sent to the browser. get and post are the two primary methods. post is the most powerful and flexible, so it is the one I use most often in this book. However, you see some interesting ways to use get later in this chapter in “Sending Data without a Form.” For that reason, I show the get technique first.


Related Topics

  Subject / Started by Replies Last post
2 Replies
Last post 06-05-2010, 09:34:39
by ryosuzuki
1 Replies
Last post 10-11-2011, 04:40:11
by C.Rebecca
5 Replies
Last post 02-22-2012, 02:36:37
by Vinil
20 Replies
Last post 09-16-2016, 05:17:01
by rajeshmehra615
0 Replies
Last post 11-15-2013, 00:24:14
by davidhodges