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

Confirm Delete With Javascript

09.16.2006
| 14069 views |
  • submit to reddit
        // confirm() returns true or false
// submit() is only called on true and submits the form

<h1>Howto Confirm Delete</h1>
<form action="delete.html" method="post">
<input type="button" onclick="if (confirm('sure?')) submit();" value="delete">
</form>