lrY.Coder
10-19-2006, 02:52 PM
Ok I am new here but I have been looking around. I am trying to make a form for my friends to fill in which will calculate their average score. Currently my script body is something like this
<HTML>
<HEAD>
<TITLE>Lab 1</TITLE>
</HEAD>
<BODY bgcolor="C0C0C0">
<SCRIPT language="JavaScript">
<!--
alert("Please enter your scores. Thank You.")
var english = ??
var maths = ??
var geography = ??
var chinese = ??
var lit = ??
var psci = ??
var lsci = ??
var art = ??
var hist = ??
var mep = ??
var total = english + maths + geography + chinese + lit + psci + lsci + art + hist + mep
var subjects = 10
document.write("Your average is " + total / + subjects)
//-->
</SCRIPT>
</BODY>
</HTML>
So what I was thinking was is it possible to make a form that will fill in the variables after they have typed it in and click ok, the variables will the be added and calculated to give the average. Any sort of help will be appreciated.
<HTML>
<HEAD>
<TITLE>Lab 1</TITLE>
</HEAD>
<BODY bgcolor="C0C0C0">
<SCRIPT language="JavaScript">
<!--
alert("Please enter your scores. Thank You.")
var english = ??
var maths = ??
var geography = ??
var chinese = ??
var lit = ??
var psci = ??
var lsci = ??
var art = ??
var hist = ??
var mep = ??
var total = english + maths + geography + chinese + lit + psci + lsci + art + hist + mep
var subjects = 10
document.write("Your average is " + total / + subjects)
//-->
</SCRIPT>
</BODY>
</HTML>
So what I was thinking was is it possible to make a form that will fill in the variables after they have typed it in and click ok, the variables will the be added and calculated to give the average. Any sort of help will be appreciated.