Hi. I want to auto calculate some fields in database without any button submit but i'm only know how to calculate using button submit. I want that user enter the value then the user will get the calculate value automatically without click on button submit. I'm doing my final year project. Any help would be greatly appeciated. Thank you. :)
<form action="laporan_kewangan.php" method="post">
<?php
include ('link_db.php');
?>
<?php
error_reporting(E_ALL & ~E_NOTICE);
$no1=$_POST['peruntukan_diluluskan'];
$no2=$_POST['jumlah_perbelanjaan'];
$tolak5=$_POST['baki'];
$tolak5=@($no1-$no2);
?>
<table width="800" border="0" align="center">
<tr>
<td width="30"><strong>1</strong></td>
<td width="170"><span class="gh"><strong>Peruntukan diluluskan (Approved budget)</strong></span><strong> </strong></td>
<td width="10">:</td>
<td width="472"><?php echo $record["peruntukan_diluluskan"]; ?><input name="peruntukan_diluluskan" type="hidden" id="peruntukan_diluluskan" readonly ="readonly" value="<?php echo $record["peruntukan_diluluskan"]; ?>" size="50" /></td>
</tr>
<tr>
<td width="30"><strong>2</strong></td>
<td width="170"><span class="hb"><span class="hb"><strong>Jumlah Perbelanjaan (Amount Spent) </strong></span></span><strong></strong></td>
<td width="10">:</td>
<td width="472"><?php echo $record["jumlah_perbelanjaan"]; ?><input name="jumlah_perbelanjaan"type="hidden" id="jumlah_perbelanjaan" readonly ="readonly" value="<?php echo $record["jumlah_perbelanjaan"]; ?>" size="30" /></td>
</tr>
<tr>
<td width="30"><strong>3</strong></td>
<td width="170"><span class="hb"><span class="hb"><strong>Baki (Balance) </strong></span></span><strong></strong></td>
<td width="10">:</td>
<td width="472"><?php echo $tolak5;
?><input type="hidden" name="baki" id="baki" value="<?php echo $tolak5;
?>" size="50" /></td>
</tr>