May 122012
 

This is how to handle confirming a deletion request via javascript. The script is shown followed by an example form using the javascript function.

<SCRIPT LANGUAGE="JavaScript">
function confirmDelete(msg1) {
  var agree=confirm(msg1);
  if (agree)
    return true ;
  else
    return false ;
}
</SCRIPT>
 
<form action="index.php" method="POST" name="deleteForm">
  <input title="Delete" onclick="return confirmDelete('$confirmationText');"
         type="image" name="delete" src="images/del.png" alt="Delete" />
</form>
 Posted by at 12:01 am