Javascript ile de sayfa yenilenmeden bu işlem yapılabilir.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
<title>hesap</title>
</head>
<body>
<form name="form1" method="post" action="">
<input type="text" name="a1" id="a1" value="">
<br>
<input type="text" name="a2" id="a2" value="">
<br>
<input type="text" name="a3" id="a3" value="">
<br>
<input type="text" name="a4" id="a4" value="">
<br>
<input type="text" name="a5" id="a5" value="">
<br>
Toplam:<input type="text" name="a6" id="a6" value="">
</form>
<script language="javascript">
for(i=1;i<6;i++)
   document.getElementById("a"+i).onkeyup=topla;
var toplam=0;
function topla()
{
   toplam=0;
   for(i=1;i<6;i++)
   {
       if (document.getElementById("a"+i).value!="")
           toplam+=parseInt(document.getElementById("a"+i).value);
   }
    document.getElementById("a6").value=toplam;
}
</script>
</body>
</html>