DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Javascript Alert Confirmation

08.25.2009
| 4369 views |
  • submit to reddit
        // description of your code here

function show_confirm_delete()
{
	var r=confirm("Delete?");
	if (r==true) {
		window.location = "frames_1.php";
	} else {
		//if deny, then do this	
	}
}

html code is:
<img onclick="show_confirm_delete()" onmouseover="this.style.cursor='pointer';" src="trash.gif" />