/    Sign up×
Community /Pin to ProfileBookmark

bold, underlined, increase font size in textarea, color

<!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:8px;
}

.vr{
font-family:lucida console,sans-serif,maroon;
color:red;
font-size: 30;
font-style:bold;underline;italics;
}
.done{
font-family:maroon,sans-serif,;
color:green;
font-size: 30;
font-style:bold;underline;italics;
}
</style>

<script type=”text/javascript”>
var nAverage, nPercentage, nGrade, nFirstName, nLastname,nStudRes;
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;
nStudRes=”SUBJECT & SCORE”;
//nStudentResult=df.nStudRes;

df.nStudentResult = nStudRes;
//df.nStudentResult.style.color=”red”

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” +nStudRes +”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. Much appreciation for the help so far. What I want is that the headings in the textarea to appear this way:
i.bold
ii. color to be maroon
iii. underlined
iv.font size to increase to 24
and secondly for image(logo) to appear as the body of the content in the textarea. It is a school software

to post a comment
JavaScript

0Be the first to comment 😎

×

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,
)...