this codes:
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<script type= "text/javascript"> 
function startCalc(){
  interval = setInterval("calc()",1);
function calc(){
    var qty = new Array(2);
    qty[0] = parseFloat(document.myform.inqty.value);
  qty[1] = parseFloat(document.myform.outqty.value);
myqtyval = qty[0]-qty[1];
document.myform.myqty.value = myqtyval;    
function stopCalc(){
<form name='myform' action='test.php' method='post'>
Input<input type='text' name='inqty'  onFocus='startCalc();' onBlur='stopCalc();' />
Output<input type='text' name='outqty'  onFocus='startCalc();' onBlur='stopCalc();' /><br/>
myqty<input type='text' name='myqty' value=''  />
<input type='submit' name='submit' value='save' />
has the concept of what i want that after i insert number in output the result was automatically appear in qty but the problem in this code it did not use on key enter and I don't know how can i put that code n my php file where I attach.
I'm sorry, i do understand the concept but I don't know how can I code it and where i can put the codes.

Thank you..