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 9018095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:26:08+00:00 2026-06-16T04:26:08+00:00

I have a dialog box on my page which is made using the JQuery

  • 0

I have a dialog box on my page which is made using the JQuery Dialog Widget.
I have set up the two buttons to have functions which will click different buttons on the page which will trigger postbacks for the page and do various things.
When the dialog box is modal: false, the dialog box will execute the relevant clickButton function, however, when i set modal: true, the button will not be clicked, although the function is entered.

I guess I am missing something about what modal: true does with regards to executing the functions associated with the buttons.

Below is my javasript

    function displayQuoteToCashMessage() {
        //this is where we do that alert for the QuoteToCash request stuff
        $("#<%=divQuoteToCashAlert.ClientId %>").show();
        $("#<%=divQuoteToCashAlert.ClientId %>").dialog({
            modal: false,
            resizable: false,
            buttons: {
                "Ok": function () {
                    //save confirmations
                    clickButton(true);
                    $(this).dialog("close");
                },
                "No": function() {
                    clickButton(false);
                    $(this).dialog("close");
                }
            }
        });        
    }

    function clickButton(b) {
        //do something with b
        document.getElementById(btnSave).click()
    };
  • 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-16T04:26:09+00:00Added an answer on June 16, 2026 at 4:26 am

    Modal prevents all kinds of events / and actions, on the overlay itself, and any DOM events below it. But regular function calls, like yours to:clickButton() are fine, if you put an alert at the beginning of that function you will see it gets there.

    The problem you are having, is that you are trying to interact with and click a DOM element that is below the modal (which is what is being denied here)

    // It gets here without a problem
    function clickButton(b) {
    
        // But this event here is what *modal* is preventing.
        document.getElementById(btnSave).click();
    }
    

    What I always do, is close the dialog first, then execute any exterior scripts (especially if I know they try to trigger dom events). By doing this, you’ll have no problems.

    jsFiddle DEMO

    buttons: {
      "Ok": function () {
    
         $(this).dialog('close');
    
         // now wait a 100 ms for it to fully close 
         // this is mainly for the slow browsers, "just in case" really
    
         setTimeout(function () {
            clickButton(); // now we call your function (knowing the modal is gone)
         }, 100);
       }
    }
    

    That tiny delay is just incase, un-noticeable, and will let you run your function while keeping modal:true

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: Display jquery flot graph in dialog box I have a page which displays
Morning. I have a form which is rendered inside of a jquery dialog box
Am using Jquery Dialog box in my xhtml page. Since there are 2 Jquery
I have 2 Jquery Dialog box on the same page. The look and feel
I want to raise a jQuery Dialog box which has 2 buttons. So that
I have a Jquery Dialog box which I want to open as soon as
i have this link which when clicked a modal dialog box will appear. <a
I have a simple Jquery dialog box, that dialog contains a button which sends
So I am using jQuery UI's dialog box. But as I have a read
I want to create a simple gsp page which will have an input box

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.