0

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>";
               
             }
3
Contributors
5
Replies
7
Views
5 Years
Discussion Span
Last Post by borgyborg
1

How about you have a go yourself and post your effort? Then we can tell you where you're going wrong. Either that or pay somebody to do your coding for you.

0

@borgyborg forum rule Keep It Organized say that you are to provide evidence of having done some work yourself if posting questions from school or work assignments. That doesn't mean that you post a code where you want to add something add someone will do rest for you.

We are NOT 24/7 coding forum for lazy individuals!

0

Thanks to both of you. I've done the JS code and it's working now. i Just didn't posted it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.