JavaScript code which is to be put in a form and pass the text thru HTML:
If you need a calculator to put into the Notes Web-page , here is the
JavaScript code which is to be put in a form and pass the text thru HTML:
<script language="JavaScript">
var expression = new Function("x1", "return eval(x1)");
function myRez(){
document.forms[0].x1.value =
expression(document.forms[0].x1.value);
}
var expression = new Function("x1", "return Math.Sin(x1)");
function mySin(){
document.forms[0].x1.value =
Math.sin(expression(document.forms[0].x1.value)*(Math.PI/180));
}
var expression = new Function("x1", "return Math.log(x1)");
function myLog(){
document.forms[0].x1.value =
Math.log(expression(document.forms[0].x1.value))/Math.LN10;
}
var expression = new Function("x1", "return Math.sqrt(x1)");
function mySqrt(){
document.forms[0].x1.value =
Math.sqrt(expression(document.forms[0].x1.value));
}
var expression = new Function("x1", "return eval(x1)");
function myClearn(){
document.forms[0].x1.value = ""
}
</script>
<p align="center"> </p>
<form action="http://www.geocities.com/ppros/Web_Help_2/toopen.htm" method
="post" name="_HTMLForm"
align="center">
<div align="center"><center><table border="2" width="27%" bordercolor="
#000080"
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
<tr>
<td width="100%" bgcolor="#C0C0C0"><div align="center"><center><p><font
face="Arial"
color="#0000A0"><strong><a href
="http://www.geocities.com/ppros/Web_Help_2/toopen.htm">CLICK </a><input
name="x1" size="16"><a href
="http://www.geocities.com/ppros/Web_Help_2/toopen.htm">
COPY</a></strong></font></td>
</tr>
<tr align="center">
<td width="100%"><div align="center"><center><table border="0" width="54%"
cellpadding="2">
<tr>
<td width="25%" align="center"><input type="button" name="btn7" value="7"
onClick="document.forms[0].x1.value+=btn7.value"></td>
<td width="25%" align="center"><input type="button" name="btn8" value="8"
onClick="document.forms[0].x1.value+=btn8.value"></td>
<td width="25%" align="center"><input type="button" name="btn9" value="9"
onClick="document.forms[0].x1.value+=btn9.value"> </td>
<td width="25%" align="center"><input type="button" name="btndiv" value=" /
"
onClick="document.forms[0].x1.value+=btndiv.value"> </td>
<td width="25%" align="center"><input type="button" name="btnsin" value="
sin"
onClick="mySin()"></td>
</tr>
<tr>
<td width="25%" align="center"><input type="button" name="btn4" value="4"
onClick="document.forms[0].x1.value+=btn4.value"></td>
<td width="25%" align="center"><input type="button" name="btn5" value="5"
onClick="document.forms[0].x1.value+=btn5.value"></td>
<td width="25%" align="center"><input type="button" name="btn6" value="6"
onClick="document.forms[0].x1.value+=btn6.value"> </td>
<td width="25%" align="center"><input type="button" name="btnmul" value=" *
"
onClick="document.forms[0].x1.value+=btnmul.value"></td>
<td width="25%" align="center"><input type="button" name="btnlog" value="
lg "
onClick="myLog()"></td>
</tr>
<tr>
<td width="25%" align="center"><input type="button" name="btn1" value="1"
onClick="document.forms[0].x1.value+=btn1.value"></td>
<td width="25%" align="center"><input type="button" name="btn2" value="2"
onClick="document.forms[0].x1.value+=btn2.value"></td>
<td width="25%" align="center"><input type="button" name="btn3" value="3"
onClick="document.forms[0].x1.value+=btn3.value"> </td>
<td width="25%" align="center"><input type="button" name="btndif" value=" -
"
onClick="document.forms[0].x1.value+=btndif.value"> </td>
<td width="25%" align="center"><input type="button" name="btnsqrt" value
="sqrt"
onClick="mySqrt()"></td>
</tr>
<tr>
<td width="25%" align="center"><input type="button" name="btn0" value="0"
onClick="document.forms[0].x1.value+=btn0.value"></td>
<td width="25%" align="center"><input type="button" name="btnpnt" value="."
onClick="document.forms[0].x1.value+=btnpnt.value"> </td>
<td width="25%" align="center"><input type="button" name="btnequ" value="
= "
onClick="myRez()"></td>
<td width="25%" align="center"><input type="button" name="btnsum" value="+
"
onClick="document.
This was first published in November 2000