Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8104873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:59:50+00:00 2026-06-05T23:59:50+00:00

I am having difficulty using JQuery UI Modal Dialog when submitting a form. The

  • 0

I am having difficulty using JQuery UI Modal Dialog when submitting a form. The intent is you hit the submit button, the modal pop ups and depending on your selection from the modal the form either submits or it doesn’t. Instead the modal pops up and automatically submits

Front end:

<div id="dialog" title="Basic dialog">
    <p>Please double check to be sure all data is entered correctly.</p>
</div>
<div class="buttons">
    <asp:Button ID="btnSave" Text="Save for later" runat="server" OnClick="btnSubmit_Click"
        ValidationGroup="GroupSave" />
    <asp:Button ID="btnSubmit" Text="Submit" runat="server" OnClientClick="return checkSubmit()" OnClick="btnSubmit_Click" />
</div>

What I have tried for the jquery/js

A.)

function checkSubmit() {
$("#dialog").dialog({ modal: true,
    buttons: { "Submit": function () { $(this).dialog("close"); return true; },
        "Go Back": function () { $(this).dialog("close"); return false; }
    }
});
}

B.)

$(document).ready(function () {
$("#dialog").dialog({ autoOpen: false,
    modal: true,
    buttons: { "Submit": function () { $(this).dialog("close"); return true; },
        "Go Back": function () { $(this).dialog("close"); return false; } 
    }
});
});

function checkSubmit() {
 $("#dialog").dialog("open");
}

I understand how B (specifically the checkSubmit) fails, all it is doing is opening the dialog but for A I thought it would work considering I am having the buttons return values but that too is essentially just opening dialog.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:59:52+00:00Added an answer on June 5, 2026 at 11:59 pm

    Use a button labeled “Submit” to open the dialog:

    <div id="dialog" title="Basic dialog">
        <p>Please double check to be sure all data is entered correctly.</p>
    </div>
    <div class="buttons">
        <asp:Button ID="btnSave" Text="Save for later" runat="server" OnClick="btnSubmit_Click" ValidationGroup="GroupSave" />
        <input type="button" id="preSubmit" value="Submit" />
        <asp:Button ID="btnSubmit" class="ui-helper-hidden" Text="Submit" runat="server" OnClick="btnSubmit_Click" />
    </div>
    

    Use the Submit button in the dialog to trigger the click event for your <asp:Button>.

    function submitForm() {
        $('input#<%=btnSubmit.ClientID %>').click();
    }
    function checkSubmit() {
        $("#dialog").dialog({
            "modal": true,
            "buttons": {
                "Submit": function() {
                    submitForm();
                },
                "Go Back": function() {
                    $(this).dialog("close");
                }
            }
        });
    }
    $(document).ready(function() {
        $('button#preSubmit').click(function(e) {
            checkSubmit();
            e.preventDefault();
            return false;
        });
        $('button#saveForLater').click(function(e) {
            $("#dialog").dialog('close');
            e.preventDefault();
            return false;
        });
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Jquery Cookie but am having difficulty setting and retrieving the info.
I'm having a bit of a difficulty using jQuery to bind a function to
I have some jQuery code that is having difficulty running because I'm using it
I'm having difficulty implementing an accordion effect on three different tables using jQuery and
I'm trying to parse an mrss feed using jquery but am having some difficulty
I am having some difficulty in using the jQuery Validator plugin. I have a
I have a page on which I'm using JQuery Mobile. I am having difficulty
I'm having difficulty changing the calue of a dropdown menu using jquery. <div class=input-box>
I'm having difficulty parsing some JSON data returned from my server using jQuery.ajax() To
I'm having a difficulty using the jQuery combobox widget as mentioned here : I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.