Can someone tell me where the problem here is? I can't get the "squared()"
function to work properly...it supposed to put the squared value into the
iframe area.
Thanks,
Ed
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
//Square Root
function squareroot()
{
x=document.root
data=x.num.valu e
var sqr=Math.sqrt(d ata)
parent.sqrt.doc ument.write(sqr )
}
//Squared of an item
function squared()
{
x=document.squa re
data=x.num.valu e
var sum=data*data
parent.squaredf rame.document.w rite()
}
//Tanget
function tangent()
{
x=document.tang ent
data=x.num.valu e
var tan=Math.tan(da ta)
parent.tangentf rame.document.w rite(tan)
}
//Refresh Values
function refresh()
{
location.reload (sqrt)
location.reload (squaredframe)
location.reload (tangentframe)
}
</script>
</head>
<body>
<table width="100%" border="1">
<tr>
<td width="73%" height="50">
<form name="root">
Type in a number to compute the square root of the value.
<input name="num2" type="text" id="num" size="10" maxlength="10">
<input name="button" type="button" onClick="square root()"
value="Compute" >
</form></td>
<td width="27%" height="50"><if rame name="sqrt" width="100%" height="50"
frameborder="0" scrolling="no"> </iframe></td>
</tr>
<tr>
<td height="50">
<form name="square">
Type in a number to compute the square of the value.
<input name="num3" type="text" id="num2" size="10" maxlength="10">
<input name="button2" type="button" onClick="square d()"
value="Compute" >
</form></td>
<td><iframe name="squaredfr ame" width="100%" height="50" frameborder="0"
scrolling="no"> </iframe></td>
</tr>
<tr>
<td height="50">
<form name="tangent">
Type in a number to compute the tanget of the value.
<input name="num" type="text" id="num3" size="10" maxlength="10">
<input name="button3" type="button" onClick="tangen t()"
value="Compute" >
</form></td>
<td><iframe name="tangentfr ame" width="100%" height="50" frameborder="0"
scrolling="no"> </iframe></td>
</tr>
</table>
<div align="right">
<form name="refresh">
Hit refresh to compute new values.
<input type="button" onClick="refres h()" value="Refresh Values">
</form>
</div>
</body>
</html>
function to work properly...it supposed to put the squared value into the
iframe area.
Thanks,
Ed
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
//Square Root
function squareroot()
{
x=document.root
data=x.num.valu e
var sqr=Math.sqrt(d ata)
parent.sqrt.doc ument.write(sqr )
}
//Squared of an item
function squared()
{
x=document.squa re
data=x.num.valu e
var sum=data*data
parent.squaredf rame.document.w rite()
}
//Tanget
function tangent()
{
x=document.tang ent
data=x.num.valu e
var tan=Math.tan(da ta)
parent.tangentf rame.document.w rite(tan)
}
//Refresh Values
function refresh()
{
location.reload (sqrt)
location.reload (squaredframe)
location.reload (tangentframe)
}
</script>
</head>
<body>
<table width="100%" border="1">
<tr>
<td width="73%" height="50">
<form name="root">
Type in a number to compute the square root of the value.
<input name="num2" type="text" id="num" size="10" maxlength="10">
<input name="button" type="button" onClick="square root()"
value="Compute" >
</form></td>
<td width="27%" height="50"><if rame name="sqrt" width="100%" height="50"
frameborder="0" scrolling="no"> </iframe></td>
</tr>
<tr>
<td height="50">
<form name="square">
Type in a number to compute the square of the value.
<input name="num3" type="text" id="num2" size="10" maxlength="10">
<input name="button2" type="button" onClick="square d()"
value="Compute" >
</form></td>
<td><iframe name="squaredfr ame" width="100%" height="50" frameborder="0"
scrolling="no"> </iframe></td>
</tr>
<tr>
<td height="50">
<form name="tangent">
Type in a number to compute the tanget of the value.
<input name="num" type="text" id="num3" size="10" maxlength="10">
<input name="button3" type="button" onClick="tangen t()"
value="Compute" >
</form></td>
<td><iframe name="tangentfr ame" width="100%" height="50" frameborder="0"
scrolling="no"> </iframe></td>
</tr>
</table>
<div align="right">
<form name="refresh">
Hit refresh to compute new values.
<input type="button" onClick="refres h()" value="Refresh Values">
</form>
</div>
</body>
</html>
Comment