Hi there,
I there i am trying to create a calculation. I have got a box where the user input the number for example 3+5, i have this code for it
<HTML>
<!-- HTML FOR INPUT FRAME (this is a separate file called input.html-->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- HIDE FROM OTHER BROWSERS
function update(field) {
var result = field.value;
var output = "" + result + " = " + eval(result);
parent.frames[1].document.forms[0].elements[0].value = output;
}
// STOP HIDING FROM OTHER BROWSERS -->
</SCRIPT>
</HEAD>
<BODY>
<FORM >
<INPUT TYPE=text onChange="update(this);">
</FORM>
</BODY>
</HTML>
and there is another box which displays the answer
<HTML>
<!-- HTML FOR OUTPUT FRAME (this is a separate file called output.html)-->
<BODY>
<FORM NAME="outputForm">
<TEXTAREA NAME=outputArea ROWS=4 COLS=40 WRAP=SOFT></TEXTAREA>
</FORM>
</BODY>
</HTML>
But its not working, could anyone help me with this?
thanks
edd
I there i am trying to create a calculation. I have got a box where the user input the number for example 3+5, i have this code for it
<HTML>
<!-- HTML FOR INPUT FRAME (this is a separate file called input.html-->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- HIDE FROM OTHER BROWSERS
function update(field) {
var result = field.value;
var output = "" + result + " = " + eval(result);
parent.frames[1].document.forms[0].elements[0].value = output;
}
// STOP HIDING FROM OTHER BROWSERS -->
</SCRIPT>
</HEAD>
<BODY>
<FORM >
<INPUT TYPE=text onChange="update(this);">
</FORM>
</BODY>
</HTML>
and there is another box which displays the answer
<HTML>
<!-- HTML FOR OUTPUT FRAME (this is a separate file called output.html)-->
<BODY>
<FORM NAME="outputForm">
<TEXTAREA NAME=outputArea ROWS=4 COLS=40 WRAP=SOFT></TEXTAREA>
</FORM>
</BODY>
</HTML>
But its not working, could anyone help me with this?
thanks
edd