how can I use the value entered in total_no_of_units and cost_per_unit in total_cost_acquistion i.e(total cost =units* cost per unit) pls suggest me any way to do it..the value value of total_cost_acquistion must be displaye as soon as the no_of_units and cost_per_units are given....
<?php
require_once "session.php";
?>
<?php
include('connection.php');
if (isset($_POST['submit'])){
$sl_no =$_POST['sl_no'];
$dec =$_POST['description'];
$loctn =$_POST['location'];
$ref_no =$_POST['reference_no'];
$d_of_aqstn =$_POST['date_of_acquisation'];
$t_of_un =$_POST['total_no_of_units'];
$cst_p_un =$_POST['cost_per_unit'];
$tl_cost_aqstn =$_POST['total_cost_of_acquistion'];
$lf_ast_pr_cdl =$_POST['life_of_assets_per_codal'];
$no_yr_ast_use =$_POST['no_year_assets_use'];
$rt_deprtn =$_POST['rate_depreciation'];
$act_deprtn =$_POST['accumulate_depreciation'];
$val_as_on = $_POST['value_as_on'];
$remks =$_POST['remarks'];
$query = "insert into form(sl_no, description, location, reference_no, date_of_acquisation, total_no_of_units, cost_per_unit, total_cost_of_acquistion, life_of_assets_per_codal, no_year_assets_use, rate_depreciation, accumulate_depreciation, value_as_on, remarks)
values('$sl_no','$dec','$loctn','$ref_no','$d_of_aqstn','$t_of_un','$cst_p_un','$tl_cost_aqstn','$lf_ast_pr_cdl','$no_yr_ast_use','$rt_deprtn','$act_deprtn','$val_as_on','$remks')";
$retval = mysql_query($query,$con);
if(!$retval )
{
die('Could not enter data: ' . mysql_error());
}
mysql_close($con);
}
?>
<html>
<head>
<meta charset = "utf-8">
<link rel = "stylesheet"
href = "//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script type = "text/javascript"
src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type = "text/javascript"
src = "https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
<title>Add a Form</title>
</head>
<body>
<h1 align="center"><strong>FIXED ASSET REGISTER</strong></h1>
<b align="center">Welcome : <i><?php echo $_SESSION['login_user']; ?> </i></b>
<br>
<form method="POST" action="<?php $PHP_SELF ?>">
<div align="center">
<table width=100% cellpadding="5" cellspacing="2" align="center">
<tr>
<td colspan="2" align="center"> <h2><strong>FORM-10</strong></h2></td>
</tr>
<tr>
<td align="right"> <strong>Serial_No:</strong></td>
<td><input type="text" name="sl_no" placeholder="Serial_no" required></td>
</tr>
<tr>
<td align="right"> <strong>Description :</strong></td>
<td><input type="text" name="description" placeholder="description" required></td>
</tr>
<tr>
<td align="right"> <strong>Location:</strong></td>
<td><input type="text" name="location" placeholder="location" required></td>
</tr>
<tr>
<td align="right"> <strong>Reference_no:</strong></td>
<td><input type="text" name="reference_no" placeholder="reference_no" required></td>
</tr>
<tr>
<td align="right"> <strong>Date_of_Acquisition:</strong></td>
<td><input type="text" name="date_of_acquisation" id = "datepicker" placeholder="date_of_acquisation" required></td>
</tr>
<tr>
<td align="right"> <strong>Total_no_of_Units:</strong></td>
<td><input type="text" name="total_no_of_units" placeholder="total_no_of_units" required></td>
</tr>
<tr>
<td align="right"> <strong>Cost per Unit:</strong></td>
<td><input type="text" name="cost_per_unit" placeholder="cost_per_unit" required></td>
</tr>
<tr>
<td align="right"> <strong>Total Acquisition Cost:</strong></td>
<td><input type="text" name="total_cost_of_acquistion" placeholder="total_cost_of_acquistion" required></td>
</tr>
<tr>
<td align="right"> <strong>Asset Life:</strong></td>
<td><input type="text" name="life_of_assets_per_codal" placeholder="life_of_assets_per_codal" required></td>
</tr>
<tr>
<td align="right"> <strong>Years asset used:</strong></td>
<td><input type="text" name="no_year_assets_use" placeholder="no_of_year_assets_use" required></td>
</tr>
<tr>
<td align="right"> <strong>Depriciation Rate:</strong></td>
<td><input type="text" name="rate_depreciation" placeholder="rate_depreciation" required></td>
</tr>
<tr>
<td align="right"> <strong>Accumulated Depriciation:</strong></td>
<td><input type="text" name="accumulate_depreciation" placeholder="accumulate_depreciation_till_31/03/2016" required></td>
</tr>
<tr>
<td align="right"> <strong>Valuation:</strong></td>
<td><input type="text" name="value_as_on" placeholder="value_as_on_31/03/2016" required></td>
</tr>
<tr>
<td align="right"> <strong>Remarks:</strong></td>
<td><input type="text" name="remarks" placeholder="remarks" ></td>
</tr>
<!-- <tr>
<td align="right"> <strong>Status: </strong></td>
<td><select name="status" required>
<option></option>
<option>New</option>
<option>Old</option>
<option>Lost</option>
<option>Damage</option>
<option>Subject for Replacement</option>
<option>Archive</option>
</select>
</td>
</tr>-->
<tr>
<td colspan="2" align="center"><input type='submit' value=' Save ' name='submit'>
</tr>
</table>
<h4 align="right"><a href="mainpage1.php">BACK</a></h4>
</div>
</form>
</body>
</html>