<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN”
“
<html lang=”en”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<meta name=”language” content=”english”>
<meta http-equiv=”Content-Style-Type” content=”text/css”>
<meta http-equiv=”Content-Script-Type” content=”text/javascript”>
<title></title>
<style type=”text/css”>
label {
float:left;
width:150px;
}
input {
margin-bottom:4px;
}
.vr{
font-family:lucida console,sans-serif;
color:#f00;
}
</style>
<script type=”text/javascript”>
var nAverage, nPercentage, nGrade, nFirstName, nLastname;
function calc() {
df=document.myform;
df.add.onclick=function() {
fMath=parseFloat(df.math.value);
fEng=parseFloat(df.eng.value);
result=fMath+fEng;
nAverage=result/2;
nPercentage=Math.round(nAverage);
nFirstName=df.firstname.value;
nLastName=df.lastname.value;
if(isNaN(result)) {
alert(‘numbers only’);
df.math.value=df.eng.value=”;
return;
}
if(nPercentage>=95 && nPercentage<=100) {
nGrade=”OUTSTANDING”
}
else if(nPercentage>=80 && nPercentage<=94) {
nGrade=”EXCELLENT”
}
df.nResult.value= /*“ttt” +”STUDENT DATA / INFORMATION” +”n”
` +”tt” +”FIRSTNAME” +”t” +nFirstName +”n”
+”tt” +”LASTNAME” +”t” +nLastName +”nn”
+”ttt” +”SUBJECT & SCORE” +”nn”
+”tt” +”MATHEMATICS” +”t” +fMath +”n”
+”tt” +”ENGLISH” +”tt” +fEng +”nn”
+”ttt” +”STUDENT RESULT” +”n”
+”TOTAL SCORE” +”t” +”AVERAGE” +”tt” +”PERCENTAGE(%)” +”t” +”GRADE”
+”n” +result +”tt” +nAverage +”tt” +nPercentage +”tt” +nGrade
df.nResult.className=’vr’;
}
}
if(window.addEventListener){
window.addEventListener(‘load’,calc,false);
}
else {
if(window.attachEvent){
window.attachEvent(‘onload’,calc);
}
}
</script>
</head>
<body>
<form action=”” name=”myform” method=”post” enctype=”text/plain” onSubmit=”document.myform.action = ‘maito:’ +document.myform.address.value”>
<DIV>
<center><b><u>STUDENT DATA / INFORMATION<BR></center></u><br>
<center>FIRSTNAME:<input type=”text” name=”firstname”></center><br>
<center>LASTNAME :</label><input type=”text” name=”lastname”></center><br>
<br>
<center><b><u>SUBJECT & SCORE</center></u><br>
<center>MATHEMATICS :<input type=”text” name=”math”></center><br>
<center>ENGLISH :<input type=”text” name=”eng”></center><br><br>
<label></label><textarea name=”nResult” cols=”60″ rows=”15″ readonly=”readonly”></textarea><br>
<input type=”button” name=”add” value=”result”>
<input type=”reset” name=”reset” value=”clear”>
</TABLE>
</div>
</form>
</body>
</html>
Thanks.The help is been wonderful so far, i highly appreciate every bit of it. please i want the body of the content in textarea to have an image. how do i di it? Thanks.