Hi All,
I want to auto-calculate all the array textboxes I created.
My code is:
<?php
echo "<table>";
$sql="SELECT default_salary FROM records WHERE is_active = 'Yes'";
while ($row=mysql_fetch_array($result)) {
$default_salary = $row["default_salary"];
$num_rows = mysql_num_rows($result);
echo "<tr>";
echo "<td>";
echo $count."</td>";
echo "<td width=\"\" align=\"left\" border=\"0\">";
echo "<input type=\"text\" size=\"4\" name=\"default_salary[]\" value=\"$default_salary\">";
echo "</td>";
echo "</tr>";
$count++ ;
}
echo "</table>";
?>
<input type="text" name="sum" value="????????">
Now i want to put the calculated value of the array "default_salary[]" to the textbox above.
Please help. Thanks in advanced.