/    Sign up×
Community /Pin to ProfileBookmark

make iage the body of content in textarea

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN”
http://www.w3.org/TR/html4/strict.dtd“>
<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.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@KorApr 07.2010 —  please i want [COLOR="Red"]the body of the content in textarea[/COLOR] to have an image. how do i di it? Thanks.[/QUOTE]
What do you mean by [I]the body of the content in textarea[/I]? Can you use the proper terminology, please? What is your aim, after all?
×

Success!

Help @ken2010 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...