Hi jaikiran,
I tried your above code but its not displaying any results in the 2nd window:
I have 2 codes here:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Arithmetic Operations </TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
//this function creates a new window and loads the window with another HTML document
function createwindow()
{
MyWindow=window.open("OperationTwoNumbers/New.html","","toolbar=yes,location=yes,"+
"directories=yes,status=yes,menubar=yes,scrollbar=yes,resizable=yes,width=475,height=475"
}//closing the function createwindow()
function addition()
{
var a = document.operations.num1.value
var b = document.operations.num2.value
var c = Number(a) + Number(b)
document.windowform.num3.value = c
}
//End Hide Script-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFBCC" onload="operations.num1.focus()">
<H2 ALIGN="CENTER"><U>Perform the Arthmetic Operations on 2 numbers</U></H2>
<BR><BR>
<FORM NAME="operations">
<DIV ALIGN="CENTER">
<FONT SIZE=4 COLOR="RED">Enter the 1st Number: </FONT>
<INPUT TYPE="text" NAME="num1" SIZE=10>
<BR><BR>
<FONT SIZE=4 COLOR="RED">Enter the 2nd Number:</FONT>
<INPUT TYPE="text" NAME="num2" SIZE=10>
</DIV>
<BR><BR>
<DIV ALIGN="CENTER">
<INPUT TYPE="button" NAME="windowform" VALUE=ADDITION
onclick="createwindow();addition(document.windowform)">
</DIV>
<BR><BR>
<DIV ALIGN="CENTER">
<INPUT TYPE="reset" VALUE="Clear Fields" onclick="operations.num1.focus()">
</DIV>
</FORM>
</BODY>
</HTML>
and the other one for another window to display the result:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Result Page</TITLE>
</HEAD>
<BODY BGCOLOR="#FFC4FC">
<H2>The Result of the Operated Function:</H2>
<BR><BR>
<FORM NAME="windowform">
<DIV ALIGN="CENTER">
<FONT SIZE=4 COLOR="RED">Output Result:</FONT>
<INPUT TYPE="text" NAME="num3" READONLY><BR><BR>
</DIV>
</FORM>
</BODY>
</HTML>