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

  • SEARCH
  • Home
  • 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 7718627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:12:41+00:00 2026-06-01T03:12:41+00:00

In the dialog form below, I have 2 buttons: Save & Cancel. When user

  • 0

In the dialog form below, I have 2 buttons: Save & Cancel. When user double-click save button, my data is posted 2 times. How can I avoid it?

$(this).dialog({
            modal: true,
            resizable: false,
            title: "Edit",
            close: function () { $(this).dialog('destroy').remove(); },
            buttons: {
                "Save": function () {
                    // Manually submit the form
                    var form = $('form', this);
                    $(form).submit();                        
                },
                "Cancel": function () { $(this).dialog('destroy').remove(); }
            }
        });

Thanks.

  • 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-01T03:12:42+00:00Added an answer on June 1, 2026 at 3:12 am

    This is an old problem. One thing that you could do is

    var submitted = false;
    $(this).dialog({
            modal: true,
            resizable: false,
            title: "Edit",
            close: function () { $(this).dialog('destroy').remove(); },
            buttons: {
                "Save": function () {
                    // Manually submit the form
                    if(!submitted){
                        submitted = true;
                        var form = $('form', this);
                        $(form).submit();                        
                    }
                },
                "Cancel": function () { $(this).dialog('destroy').remove(); }
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that is generated when a user clicks a button, and
i load a form into a jquery ui dialog. i have a submit button
My partialView is Opened in the modal dialog form, User select special row, I
I have a form and from this I call dialogPrintDiet.ShowDialog() which launchs my dialog.
Dialog closes with Cancel result, no exceptions, as if you have pressed its close
I have a jquery ui dialog with a knockoutjs submit binding on a form.
I have the link below that executes the action message/new which shows a form
I have a simple YUI dialog with 2 buttons - Accept and Decline. I
I have code that opens a dialog, validates, and posts a form when the
i have this form below: <form fbcontext=65d93ec1624a id=app23744633048_frmFBNewsletter action=http://register.stage.creative.com/Api/Facebook/SubscribeNewsletter method=post><input type=hidden value=117533374986109 name=fb_sig_profile><input type=hidden

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.