Skip to content

Instantly share code, notes, and snippets.

@dcblogdev
Created September 4, 2013 20:01
Show Gist options
  • Save dcblogdev/6442104 to your computer and use it in GitHub Desktop.
Save dcblogdev/6442104 to your computer and use it in GitHub Desktop.
Delete confirmation example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Demo</title>
<script language="JavaScript" type="text/javascript">
function delnews(id,title)
{
if (confirm("Are you sure you want to delete '" + title + "'")){
window.location.href = 'del.php?news=' + id;
}
}
</script>
</head>
<body>
<input type="button" onclick="javascript:delnews('1','this item')" value="delete">
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment