probably something ridiculous but i think I have snow goggles on as i just came from an exam.... and have been looking at it since. Can anyone see why this is not computing and displaying the alert..... Its ridiculously simple code
<%--
Document : Q1 Summer Exam
Created on : 10-May-2010, 15:02:26
Author : k00-----
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<script type="text/javascript">
function calculateTotal(){
name=document.form1.getElementById(name)
product1=document.form1.getElementById(keyboard*40)
product2=document.form1.getElementById(mouse*24)
product3=document.form1.getElementById(hardDisk*55)
product4=document.form1.getElementById(usb*6)
total=product1+product2+product3+product4
if(total==null){
alert("Please enter a name, a payment method and your quantity for product")
}
else
alert("Customer name: "+name+", Your Total Cost Is "+total+(total/100*10))
}
</script>
</table>
</form>
</body>
</html>
sorry if its embarrasingly simple.... I am a student!
Bookmarks