$('#delete').submit(function(event){
     if(!confirm("some text")){
        event.preventDefault();
      }
    });
Answer from iHadaj on Stack Overflow
Discussions

Submit Form ( POST ) after confirmation
When the button is clicked - the form is submitted. I would like a confirmation box (Yes - Delete, No ). I dont understand how to incorporate jquery-confirm into the button above from the documentation provided. More on github.com
🌐 github.com
5
July 20, 2017
[jQuery] Dialog confirmation before submit
🌐 forum.jquery.com
February 11, 2016
Jquery Validate Plugin: A confirm alert on submit
🌐 forum.jquery.com
[Resolved] Are you Sure? jQuery popup on Form Submit
Tell us what you are trying to do? Hi. I'm trying to prompt the user see if they are sure they want to submit the form. I'm using the following More on toolset.com
🌐 toolset.com
November 26, 2022
🌐
SitePoint
sitepoint.com › javascript
[jQuery] Confirmation Dialog Upon Submission - JavaScript
July 3, 2013 - Can’t you just pass a success function to the ConfirmDialog function, which will be run when the Yes button is pressed? Here’s the setup, where we prevent the default submit action, this time, and we save off a reference to the form so that we can then trigger an actual submit event later on from that function being passed to ConfirmDialog:
🌐
GitHub
github.com › craftpip › jquery-confirm › issues › 300
Submit Form ( POST ) after confirmation · Issue #300 · craftpip/jquery-confirm
July 20, 2017 - Hi, I have a bootstrap form with a submit button as below; Delete Selected User When the button is clicked - the form is submitted. I would like a confirmati...
Author   marcoczen
🌐
Joget
confluence.joget.org › community › questions › 25593523 › how-to-confirm-before-submit-process
How to confirm before submit process - Joget | COMMUNITY
There is two possible submit id "#assignmentComplete or #submit", just add a "#submit" to your jquery as follows: <script type="text/javascript"> $(document).ready(function() { $("#assignmentComplete,#submit").on("click", function() { if (confirm("Are you sure to send email ?")) { return true; ...
🌐
Mauricius
mauricius.dev › confirm-form-submission-without-loops-using-jquery
Confirm form submission without loops using jQuery – Yet Another Boring Developer's Blog
July 14, 2018 - $(form).on('submit', function() { dialog.confirm({ message: 'Do you really want to submit the form?', confirm: function() { $(form).submit(); }, cancel: function() {} }); return false; }); otherwise we are stuck in an infinite loop, where the ...
Find elsewhere
🌐
Github
craftpip.github.io › jquery-confirm
jquery-confirm.js | The multipurpose alert & confirm
A multipurpose alert, confirm plugin, alternative to the native alert() and confirm() functions. Supports features like auto-close, themes, animations, and more.
🌐
ASPSnippets
aspsnippets.com › questions › 693832 › Confirm-before-Submit-on-specific-ASPNet-Button-Click-using-JavaScript-and-jQuery
Confirm before Submit on specific ASPNet Button Click using JavaScript and jQuery
April 9, 2019 - i want to give button name like if i have 2 button on same page i want to call it on button1 but when button2 click it should not give confirmation alert please advice. ... To alert for specific button use below code. ... <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript"> var clicked = ""; $(function () { $("input[type=submit]").click(function (e) { clicked = e.target.id; }); }); function WebForm_OnSubmit() { if (clicked
🌐
Dad-union
dad-union.com › en › jquery-form-confirm-dialog
How to Implement a Confirmation Dialog Before Form Submission with jQuery|DAD UNION - Engineers Alliance
October 12, 2025 - Below is a sample form that displays a confirmation dialog before submission. Assign class="dadform" to the form tag. This form includes a “Confirm” button (type="submit"). <h1>Use window.confirm and jQuery’s submit to display a confirmation ...
🌐
Primary Objects
primaryobjects.com › 2012 › 03 › 21 › creating-a-jquery-modal-confirmation-dialog-when-submitting-a-form
Creating A jQuery Modal Confirmation Dialog When Submitting a Form | Primary Objects
May 7, 2021 - When a web application form is lengthy or detailed in nature, it may be a good idea to display a confirmation of the values the user entered, prior to submitting the data. Rather than navigating the user away from the form to display the confirmation, web applications can take advantage of javascript (particularly jQuery and jQuery UI) to display a modal popup dialog containing the form field values.
🌐
Myclabs
myclabs.github.io › jquery.confirm
jquery.confirm
post: If false (default) and no confirm handler is set, redirects the user to the URL of the button/link with a GET request. If true, redirects with a POST request (like a form submission). submitForm: If false (default) it has no effect.
Top answer
1 of 4
5

Hmm... theres is a problem with the other answers on here: they don't work against your HTML.

There's a bug in jQuery (I assume it's a bug), where if an element on your form has aname of submit, then triggering the submit event of the form will not work.

You will need to remove the name attribute from your input type="submit" button or simply give it a name other than "submit".

HTML

<form action ="/submit-page/" method='post' class="editable">
  <fieldset>
    <select name="status" id='status'>
      <option value="Submitted">Submitted</option>
      <option value="Canceled">Canceled</option>
      <option value="Application">Application</option>
    </select>
    <input type="submit" value="SAVE" name="submit-button"/>
  </fieldset>
</form>​

jQuery

$('#status').on('change', function() {

    var $this = $(this),
        val = $this.val();

    if (val === 'Canceled' && confirm("are you sure?")) {
        $this.closest('form').submit();
    }
});​

PHP

$submitted = !empty($_POST['submit-button']);

if($submitted)
{
    // Submit button was pressed.
}
else
{
    // Form was submitted via alternate trigger.
}

Example

Working: http://jsfiddle.net/xixonia/KW5jp/

Not Working: http://jsfiddle.net/xixonia/KW5jp/1/

Edit

You have since updated your question, and this answer is no longer a valid solution for what you are looking for. Instead, look at Chris Platt's answer.

Edit Again

This is a modified version of Chris Platt's answer. It simply waits until the DOM is ready (elements are loaded) before it executes the logic contained within the first $(...).

$(function() { // this first jQuery object ensures that...

    /// ... the code inside executes *after* the DOM is ready.

    $('form.editable').submit(function(){
        if ($('#status').val()=='Canceled') {
            if (!confirm('Warning message here. Continue?')) {
                return false;
            }
        }
    });

});
2 of 4
1
$('form.editable').submit(function(){
    if ($('#status').val()=='Canceled') {
        if (!confirm('Warning message here. Continue?')) {
            return false;
        }
    }
});