<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <script language="JavaScript">
    function chk(){

    var a1=parseFloat(document.frm.a1.value);
    var a2=parseFloat(document.frm.a2.value);
    var a3=parseFloat(document.frm.a3.value);
    var a4=parseFloat(document.frm.a4.value);
    var a14=parseFloat(document.frm.a14.value);

    var a5=parseFloat(document.frm.a5.value);
    var a6=parseFloat(document.frm.a6.value);
    var a7=parseFloat(document.frm.a7.value);
    var a8=parseFloat(document.frm.a8.value);
    var a9=parseFloat(document.frm.a9.value);
    var a10=parseFloat(document.frm.a10.value);
    var a11=parseFloat(document.frm.a11.value);
    var a12=parseFloat(document.frm.a12.value);
    var a13=parseFloat(document.frm.a13.value);

    var a1sum=parseFloat(document.frm.a1sum.value);
    var a2sum=parseFloat(document.frm.a2sum.value);

    document.frm.a1sum.value=a1+a2+a3+a4+a14;
    document.frm.a2sum.value=a5+a6+a7+a8+a9+a10+a11+a12+a13;
    document.frm.sum.value=a1sum+a2sum;

    }
    </script>
    <?php
     $A1 = '222,2222.05';
    ?>
    <body>
    <form action="" name="frm"><br>
    <input type="text" name="a1" onKeyUp="chk()" value="<?php echo $A1; ?>">
    <input type="text" name="a2" onKeyUp="chk()">
    <input type="text" name="a3" onKeyUp="chk()">
    <input type="text" name="a4" onKeyUp="chk()">
    <input type="text" name="a14" onKeyUp="chk()"> <br><br>

    <input type="text" name="a5" onKeyUp="chk()">
    <input type="text" name="a6" onKeyUp="chk()">
    <input type="text" name="a7" onKeyUp="chk()">
    <input type="text" name="a8" onKeyUp="chk()">
    <input type="text" name="a9" onKeyUp="chk()">
    <input type="text" name="a10" onKeyUp="chk()">
    <input type="text" name="a11" onKeyUp="chk()">
    <input type="text" name="a12" onKeyUp="chk()">
    <input type="text" name="a13" onKeyUp="chk()">  <br><br>

    <input type="text" name="a1sum" onKeyUp="chk()"> <br>
    <input type="text" name="a2sum" onKeyUp="chk()"> <br>

    <input type="text" name="sum" onKeyUp="chk()"> <br>

    </form>
  </body>
</html>
