This is text field t1. This will be the input field.
Type an arithmetic expression into this field. Use operators(+ - * /).

This is text field t2. This will be the output field.

This button will evaluate the expression in t1 and hold it in variable "result".

This button will cause the result to be displayed in t2.

Note that you can type into t2 and then re-display the result.


The javascript in the HEAD of this document.

<SCRIPT>

function calculate(){
result=eval(document.f1.t1.value);

}


function display(){
document.f1.t2.value=result
}

</SCRIPT>