you’re on your way 4
75
ajax requests
HTML 101: accepting user input
The Break Neck order form already has elds for the customer to
enter in their phone number, address, and pizza order. Let’s take
a quick look at the HTML for the order form, and then gure out
how to connect this HTML to the JavaScript you’ll be writing:
<html>
<head>
<title>Break Neck Pizza Delivery</title>
<link rel=”stylesheet” type=”text/css” href=”breakneck.css” />
</head>
<body>
<p>
<img src=”breakneck-logo.gif”
alt=”Break Neck Pizza” />
</p>
<form method=”POST” action=”placeOrder.php”>
<p>Enter your phone number:
<input type=”text” size=”14” name=”phone” />
</p>
<p>Your order will be delivered to:</p>
<p><textarea name=”address” rows=”4” cols=”50”>
</textarea></p>
<p>Type your order in here:</p>
<p><textarea name=”order” rows=”6” cols=”50”></textarea></p>
<p><input type=”submit” value=”Order Pizza” /></p>
</form>
</body>
</html>
You’ll ll this in with
the address that the
server returns, but
let’s leave it as a
eld so a customer
can enter a different
address if the want.
Here’s where
the customer
enters his
phone number.
A normal “submit” button
is used for placing the
order, using a form POST.
This is the URL for
placing the pizza