You want to reverse an accidental submission to a database, correct? That's what my suggestion is intended to address.The code above does not interact with the server. Most likely, it will be helpful in confirming form submission. If the user clicks 'ok', the request proceeds, else it fails. And the buttons aren't what I meant: they're JavaScript dialog buttons, not HTML.You can do it without AJAX.Did you understand my suggestion?