I have below code to load xml to grid (without any problems) and an Insert button to save the grid data to table.
In data_insert.asp, I would like to iterate all the rows in grid and insert it to a table.
How do I do this?
i have tried to get the ideas from this code which is in PHP but fail to get the solutions. For your information I’m familiar with PHP and ASP.
My question is where $_POST[“ids”] coming from? If I know $_POST[“ids”] I can use this variable to iterate it in ASP.
---- PHP sample code, update_all.php —
$ids = explode(",",$_POST[“ids”]);
//for each row
for ($i=0; $i < sizeof($ids); $i++) {
$rowId = $ids[$i]; //id or row which was updated
$newId = $rowId; //will be used for insert operation
$mode = $POST[$rowId."!nativeeditor_status"]; //get request mode
switch($mode){
case "inserted":
//row adding request
$action = add_row($rowId);
break;
case "deleted":
//row deleting request
$action = delete_row($rowId);
break;
default:
//row updating request
$action = update_row($rowId);
break;
}
echo "<action type='".$action."' sid='".$rowId."' tid='".$newId."'/>";
}
---- My code —
<INPUT TYPE="SUBMIT" name="FF_insert" onClick="document.pressed=this.value" VALUE="Insert">