Show dialog before submit

I have a form with a submit button, and I want to show a dialog before continuing the submission. The code below is showing the dialog properly, but it continues the submit anyway.

@using (Html.BeginForm("SubmitForm", "Home", FormMethod.Post, new { id = "form" }))

    <div class="collapseClosed panel-footer panel-collapse collapse in">
      <input type="submit" name="btnSubmit" id="btnSubmit" class="btn btn-success" value="Submit" />
<div id="confirm" title="Confirm">
    <span id="confirmtext"></span>

    $("#btnSubmit").on("click", function () {
        currentForm = $(this).closest('form');
        $("#confirmtext").text("Please confirm.");

Source: html5

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.