HW5
- افتح الملف المرفق totalcost وعدل ما يلزم لتحقيق الشروط التالية:
ملاحظه:-
- العامود الاول خاص باسم المنتج (product name).
- العامود الثاني خاص بسعر السلعة الواحده من المنتج(price).
- العامود الثالث خاص عدد السلع من المنتج الواحد (quantity).
الشروط المطلوب تحقيقها:
1- بمجرد الضغط على الزر الخاص ب Total Cost يستدعي دالة تجمع تكلفة كل السلع وتظهر اجمالي التكلفة في الخانة الفارغة امام الزر Total Cost.
الكوووووووود:
<html>
<head> <title> The focus event </title>
<script type = "text/javascript">
<!--
// The event handler function to compute the cost
// Compute the cost
-->
</script>
</head>
<body>
<form action = "">
<h3> Coffee Order Form </h3>
<!-- A bordered table for item orders -->
<table border = "border">
<!-- First, the column headings -->
<tr>
<th> Product Name </th>
<th> Price </th>
<th> Quantity </th>
</tr>
<!-- Now, the table data entries -->
<tr>
<th> French Vanilla (1 lb.) </th>
<td> $3.49 </td>
<td> <input type = "text" id = "french"
size ="2" /> </td>
</tr>
<tr>
<th> Hazlenut Cream (1 lb.) </th>
<td> $3.95 </td>
<td> <input type = "text" id = "hazlenut"
size = "2" /> </td>
</tr>
<tr>
<th> Columbian (1 lb.) </th>
<td> $4.59 </td>
<td> <input type = "text" id = "columbian"
size = "2" /></td>
</tr>
</table>
<!-- Button for precomputation of the total cost -->
<p>
<input type = "button" value = "Total Cost"
onclick = "...........;" />
<input type = "text" size = "5" id = "cost"
onfocus = "this.blur();" />
</p>
<!-- The submit and reset buttons -->
</form>
</body>
</html>