<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1...
<html>
<head>
<title>Don's Digital Photo Development</title>
<script type="text/javascript">
var todayDate = new Date();
function loadDate() {
todayDate = new Date();
var month = todayDate.getMonth() + 1;
var day = todayDate.getDate();
var year = todayDate.getFullYear();
currentDate = month + "/" + day + "/" + year;
document.getElementById("date").value = currentDate;
}
function orderReady(days) {
var pickupDate = (todayDate.getMonth() + 1) + '/' +
(todayDate.getDate() + Number(days)) + '/' +
(todayDate.getFullYear());
document.getElementById('pickup').value = pickupDate;
}
function Open_win() {
var name = document.getElementsByName('firstName')[0].value + ' ' +
document.getElementsByName('lastName')[0].value;
var phone = document.getElementsByName('phone')[0].value;
var radio = document.getElementsByName('itemType');
var order = '';
for (i = 0; i < radio.length; i++) {
if (radio[i].checked)
order = radio[i].title;
}
var date = document.getElementById('date').value;
var pickup = document.getElementById('pickup').value;
var popup = window.open("",
"_blank",
"width=400, height=300, menubar=yes, toolbar=yes");
popup.document.writeln("<html><head><title>Order Receipt</title></head>" +
"<body>" +
"<h1>Order Receipt</h1>" +
"<b>Name:</b>" + name + "<br />" +
"<b>Telephone:</b>" + phone +
"<p><b>Order:</b>" + order + "<br />" +
"<b>Order Date :</b>" + date + "<br />" +
"<b>Pickup Date:</b>" + pickup +
"</body></html>");
popup.document.close();
}
</script>
</head>
<body onload="loadDate();">
<form>
<h1>Don's Digital Photo Development</h1>
<p>
First Name: <br /><input type="text" name="firstName" size="50" value="" /><br />
Last Name: <br /><input type="text" name="lastName" size="50" value="" /><br />
Telephone: <br /><input type="text" name="phone" size="50" value="" />
</p>
<p>
Items
<input type="radio" name="itemType" value="1" title="5 x 7 Prints"
onclick="orderReady(this.value)"/>5 x 7 Prints(1 day)
<input type="radio" name="itemType" value="1" title="Poster"
onclick="orderReady(this.value)"/>Poster (1 day)
<input type="radio" name="itemType" value="2" title="Coffee Mug"
onclick="orderReady(this.value)"/>Coffee Mug (2 Days)
<input type="radio" name="itemType" value="3" title="T-shirt"
onclick="orderReady(this.value)"/>T-shirt (3 days)
</p>
<p>
Today's Date: <input type="text" id="date" name="orderdate" size="50"/><br />
Pick-up Date: <input type="text" id="pickup" name="pickupdate" size="50"/>
</p>
<input type="submit" value="Place Order" onclick="Open_win()"/>
</form>
</body>
</html>