/    Sign up×
Community /Pin to ProfileBookmark

can i have alternative to this

====================first window===========================
<html>
<head>
<script language=”javascript”>
var newWindow;
function call() {
newWindow=window.open(“gagut.html”, “gagut”)
}
</script>
</head>
<body>
<form>
MATHEMATICS <INPUT TYPE=”TEXT” NAME=”math” SIZE=”5″><br>
ENGLISH <INPUT TYPE=”TEXT” NAME=”eng” SIZE=”5″><br>
<br>
<input type=”button” name=”add” value=”RESULT” onClick=”call()”>
</form>
</body>
</html>

===================second window===========================

<html>
<head>
<script language=”javascript”>
function getIt() {

var fMath=self.opener.document.forms[0].math.value;
strMath=fMath.toUpperCase();
if(strMath.length==0) {
opener.alert(“Please enter score for Mathematics”);
}
if(isNaN(strMath)) {
opener.alert(“Please enter figure for Mathematics”);
//strMath=””;
}

var goodness=”<HTML><BODY><CENTER><TABLE CELLPADDING=0, CELLSPACING=15 BGCOLOR=BLUE>”
goodness +=”<CAPTION><ALIGN=TOP><B><U><FONT COLOR=MAROON> SUBJECT / SCORE ” +”</FONT></U></B></CAPTION>”
if(strMath.length==0) {
strMath=0;
goodness +=”<TR><TD ALIGN=RIGHT><B>MATHEMATICS :<B></TD>” +”<TD><I>” +”ABSENT” +”</I></TD>”;

}
else{
goodness +=”<TR><TD ALIGN=RIGHT><B>MATHEMATICS <B></TD>” +”<TD><I>” +strMath +”</I></TD>”;
}

//——————-validating English values————————+

var fEng=self.opener.document.forms[0].eng.value;
strEng=fEng.toUpperCase();
if(strEng.length==0) {
opener.alert(“Please enter score for English”);
}
if(isNaN(strEng)) {
opener.alert(“Please enter figure for English”);
//strEng=””;
}
if(strEng.length==0) {
strEng=0;
goodness +=”<TD ALIGN=RIGHT><B>ENGLISH <B></TD>” +”<TD><I>” +”ABSENT” +”</I></TD></TR>”;
}
else{
goodness +=”<TD ALIGN=RIGHT><B>ENGLISH <B></TD>” +”<TD><I>” +strEng +”</I></TD></TR>”;
}

goodness +=”</TABLE></CENTER></BODY></HTML><BR></BR>”;
document.myForm.textMe.value = goodness;
document.myForm.textMe.style.color=”red”
//document.myForm.textMe.style.face=”verdana”

/*var result, nMath, nEng;

nMath=parseInt(strMath);
nEng=parseInt(strEng);
result = nMath+nEng;*/

}
</script>
</head>
<body onLoad=”getIt()”>
<form name=”myForm”>
<textarea name=”textMe” cols=30 rows=30 readonly></textarea><br>
<input type=”button” name=”submit” value=”SUBMIT”>
</form>
</body>
</html>

thanks. Please this i need your help for,. When i input data from the first window it appears in the textarea of the second window retrieving the table tags, this is not what i want. i want the the table to come out as a table and the content from the first window to appear in the table, in the textarea of the second window with color blue and font face – lucida console like this:

MATHEMATICS 60
ENGLISH 70
RESULT 130
Thanks. God bless. If html can not appear in textarea , please help me out with the best way to go about it.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@ken2010authorMar 16.2010 — ====================first window===========================

<html>

<head>

<script language="javascript">

var newWindow;

function call() {

newWindow=window.open("gagut.html", "gagut")

}

</script>

</head>

<body>

<form>

MATHEMATICS <INPUT TYPE="TEXT" NAME="math" SIZE="5"><br>

ENGLISH <INPUT TYPE="TEXT" NAME="eng" SIZE="5"><br>

<br>

<input type="button" name="add" value="RESULT" onClick="call()">

</form>

</body>

</html>

===================second window===========================

<html>

<head>

<script language="javascript">

function getIt() {

var fMath=self.opener.document.forms[0].math.value;

strMath=fMath.toUpperCase();

if(strMath.length==0) {

opener.alert("Please enter score for Mathematics");

}

if(isNaN(strMath)) {

opener.alert("Please enter figure for Mathematics");

//strMath="";

}

var goodness="<HTML><BODY><CENTER><TABLE CELLPADDING=0, CELLSPACING=15 BGCOLOR=BLUE>"

goodness +="<CAPTION><ALIGN=TOP><B><U><FONT COLOR=MAROON> SUBJECT / SCORE " +"</FONT></U></B></CAPTION>"

if(strMath.length==0) {

strMath=0;

goodness +="<TR><TD ALIGN=RIGHT><B>MATHEMATICS :<B></TD>" +"<TD><I>" +"ABSENT" +"</I></TD>";

}

else{

goodness +="<TR><TD ALIGN=RIGHT><B>MATHEMATICS <B></TD>" +"<TD><I>" +strMath +"</I></TD>";

}

//-------------------validating English values------------------------+

var fEng=self.opener.document.forms[0].eng.value;

strEng=fEng.toUpperCase();

if(strEng.length==0) {

opener.alert("Please enter score for English");

}

if(isNaN(strEng)) {

opener.alert("Please enter figure for English");

//strEng="";

}

if(strEng.length==0) {

strEng=0;

goodness +="<TD ALIGN=RIGHT><B>ENGLISH <B></TD>" +"<TD><I>" +"ABSENT" +"</I></TD></TR>";

}

else{

goodness +="<TD ALIGN=RIGHT><B>ENGLISH <B></TD>" +"<TD><I>" +strEng +"</I></TD></TR>";

}

goodness +="</TABLE></CENTER></BODY></HTML><BR></BR>";

document.myForm.textMe.value = goodness;

document.myForm.textMe.style.color="red"

//document.myForm.textMe.style.face="verdana"

/*var result, nMath, nEng;

nMath=parseInt(strMath);

nEng=parseInt(strEng);

result = nMath+nEng;*/

}

</script>

</head>

<body onLoad="getIt()">

<form name="myForm">

<textarea name="textMe" cols=30 rows=30 readonly></textarea><br>

<input type="button" name="submit" value="SUBMIT">

</form>

</body>

</html>

thanks. Please this i need your help for,. When i input data from the first window it appears in the textarea of the second window retrieving the table tags, this is not what i want. i want the the table to come out as a table and the content from the first window to appear in the table, in the textarea of the second window with color blue and font face - lucida console like this:

MATHEMATICS 60

ENGLISH 70

RESULT 130

Thanks. God bless. If html can not appear in textarea , please help me out with the best way to go about it.

Edit/Delete Message
Copy linkTweet thisAlerts:
@FangMar 16.2010 — You could write the table to the child window or to the parent.
×

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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...