I am on the process of modifying old code. I want to have set of input fields as rows in a table with Update button along with them. Below code is included in seperate ajax_edit_designation.php page which is being called by the edit_designation page. When the update is selected it should enter the new value to the database. The script required for it is written in the edit_designation.php page.
I would like to know whether what I am doing is correct or wrong. Because for some reason it doesn't carryout required action when the 'Update' button is selected. In the browser console it doesn't throw any exceptions either. What am I doing wrong?
Is it something that happen due to some kind of version issue? Or am I really doing something wrong?
echo "<table>";
while($row_tay = mysql_fetch_array($result_tay)){
$temp++;
$designation = $row_tay['designation'];
$designationID = $row_tay['designationID'];
echo "<tr ";
if($temp%2 == 1)
{
echo " bgcolor =\"#F3F3F3\" ";
}
else
{
echo " bgcolor =\"#DBDBDB\" ";
}
echo " >";
echo "<form id=\"myform".$designationID."\" method=\"post\">";
echo "<td class=\"bodytext\">";
echo "<input type=\"text\" id=\"designation\" size=\"50\" value=\"".htmlentities($designation)."\" name=\"designation\" />";
echo "</td>";
echo "<td width=\"120\" align=\"center\">";
echo "<input name=\"addcat\" id=\"addcat\" type=\"submit\" value=\"Update\" class=\"Submit_Button_long\">";
echo "<input type=\"hidden\" name=\"designationID\" value=\"".$designationID."\">";
echo "</td>";
echo "</form>";
echo "</tr>";
}
echo "</table>";
Because, same thing happened to me in another page also, where I added seperate form tags as above. In that case, previously it had given all the Update buttons under same tag. When I remove that earlier form tag and add only the new tags as above, they didn't work as now. But if I add that previously available tag, by wrapping all those forms created with the table, Update buttons worked. What could be the reason. Please help?