I am using delete by ID system. The user enters the id of the record he/she wishes to remove and is done so through PHP. This is all working and when successfully removed a little alert box confirms this and is brought back to the original page, which shows the record is no longer there. However, I would like to use AJAX in a way that does not refresh the page and keeps the table on screen.
<head>
<title>ajax_test</title>
<script language="javascript" type="text/javascript" src="prototype.js"></script>
<script>
function updateDIV(myDiv)
{
var url='delete.php';
var params = 'id';
var myAjax = new Ajax.Updater(myDiv, url, {method: 'get', parameters: params});
}
</script>
</head>
<body>
<form action="delete.php" method="get">
<input type="text" name="id" placeholder="ID" />
<input type="submit" value="Delete" onclick="updateDIV(targetDiv)" />
<div id="targetDiv"></div>
</form>
</body>
As you can probably see, this is not working. Is there any blatant problems that I should be researching further?