
<FRAMESET COLS="50%,*"><FRAME SRC="input.htm" NAME="input"> <FRAME SRC="output.htm" NAME="output"> </FRAMESET> <SCRIPT> /* this function takes value from an input box on this frame & then passes results to a textarea box on another frame. eval() calculates the mathematical expression. */ function update(field) {var result = field.value; var output = result + " = " + eval(result); parent.frames[1].document.forms[0].result.value = output; } /* here we get the value from an input box on another frame & then pass the result back to the very same input box on the other frame. */ function passinfo(form) { var result = form.inputfld.value; var output = result + " = " + eval(result); parent.output.document.form2.inputfld.value = output; } </SCRIPT> <BODY> <FORM> <INPUT TYPE="text" NAME="input" onChange="update(this);"> </FORM>
<FORM> NOTE: onClick causes a call to be made to a function in another frame <FORM NAME="form2"> |