-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex1.html
executable file
·90 lines (77 loc) · 2.53 KB
/
index1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<html>
<head>
<link rel="stylesheet" type="text/css" href="CSS/style.css">
<script type="text/javascript">
function showItem()
{
var arg=document.getElementById("item");
var k=arg.options[arg.selectedIndex].value;
window.open('showitem.html?n='+k,'width=400','height=400');
}
function getname()
{
var text = session.getAttribute("Name");
alert('Hi!');
}
function validateQuantity(inputField,helpText)
{
if (inputField.value.length == 0)
{
if (helpText != null)
helpText.innerHTML = "Please enter a value.";
return false;
}
else
{
if (helpText != null)
helpText.innerHTML = "";
return true;
}
}
</script>
<title>Shopping Cart</title>
</head>
<body onload="getname();">
<form id="shopform" name="shopform" method="post" action="CartServlet">
<h1>Hop in Shop out!</h1>
<br/><div id="lefty">
Enna vaenum Ungalukku?
<select id="item" name="item" >
<optgroup label="T Shirts">
<option value="adidas">Adidas T-Shirt</option>
<option value="reebok">Reebok T-Shirt</option>
<option value="nike">Nike T-Shirt</option>
</optgroup>
<optgroup label="Sarees">
<option value="kanchipuram">Kanchipuram Silk Saree</option>
<option value="ahimsa">Ahimsa Silk Saree</option>
<option value="samudrika">Samudrika Pattu Saree</option>
</optgroup>
<optgroup label="Jeans">
<option value="denim">Denim Jeans</option>
<option value="levis">Levis Jeans</option>
<option value="pepe">Pepe Jeans</option>
</optgroup>
</select>
</div>
<div id="lefty">
Quantity
<input type="text" name="quantity" id="quantity" size=2 onblur="validateQuantity(this,document.getElementById('add_help'))">
<span id="add_help"></span>
</div>
<br/>
<div id="lefty">
<input type="button" id="look" value="Have a closer look!" onclick="showItem();" >
<input type="submit" name="submit" id="submit" value="Add to cart!" onclick="validateQuantity(quantity,document.getElementById('add_helptext'))">
<span id="add_helptext"></span>
</div>
</form>
<form id="checkout" name="checkout" method="post" action="CalcServlet">
<div id="lefty">
<input type="submit" name="submit" id="submit" value="Check Out">
</div>
</form>
</body>
</html>