954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Auto Calculate Text Boxes onload & onkeyup

Hi,

I would like to have a php script or javascript to calculate the array textboxes where values fetched from the database.

My array textboxes code below:

$sql="SELECT * FROM records WHERE is_active = 'Yes'";   
            $result=mysql_query($sql,$connection) or die(mysql_error());
 
       while ($row=mysql_fetch_array($result)) {
                $default_salary = $row["default_salary"];
 
        echo "<input onkeyup=\"AddInputs()\" type=\"text\" class=\"validate[required,custom[onlyNumberSp],maxSize[5],minSize[3]] text-input\" id=\"default_salary[$id]\" size=\"4\" name=\"default_salary[$id]\" value=\"$default_salary\" >";
        echo "</td>";
        echo "<td width=\"\" align=\"left\" border=\"0\">";
        echo "<input type=\"text\" class=\"validate[required,custom[onlyNumberSp],maxSize[5],minSize[1]] text-input\" id=\"additional_salary[$id]\" size=\"4\" name=\"additional_salary[$id]\" value=\"0\">";
        echo "</td>";
 
             }
borgyborg
Newbie Poster
12 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: