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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:27:47+00:00 2026-06-13T00:27:47+00:00

I having trouble displaying buttons in my jquery-ui dialog box after I set autoOpen

  • 0

I having trouble displaying buttons in my jquery-ui dialog box after I set autoOpen to false.

I set up my dialog box with a button like this.

$(document).ready(function() {
    $("#dialog-form").dialog({
        autoOpen: false,
        modal: true,
        buttons: {
            Ok: function() {
                $(this).dialog("close");
            }
        }
    });
});

After clicking on something else on the page, I run this line to open up my dialog box.

$("#dialog-form").dialog("open");

However, the dialog box does not show any buttons. I find that if I set autoOpen: true, then the buttons will show up when the dialog box immediately opens. How can I get the buttons to show while requiring the dialog box to be opened through call (i.e. setting autoOpen: false)?

  • 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-13T00:27:48+00:00Added an answer on June 13, 2026 at 12:27 am

    According to the API the original code should work too:
    An example from the API:

    ....
    <script>
    $( "#dialog" ).dialog({ autoOpen: false });
    $( "#opener" ).click(function() {
        $( "#dialog" ).dialog( "open" );
    });
    </script>
    ...
    

    I didn’t see the code initialized at document ready … if the code is not initialized at document ready the part containing tags for the widget could not be loaded yet and the widget will be not initialized. When calling $( "#dialog-form" ).dialog( "open" ); an new initalization will be applied so the buttons will not appear.

    Put your JS init code inside a document.ready section

    $(function() {
    
      $("#dialog-form").dialog({
        autoOpen: false,
        modal: true,
        buttons: {
            Ok: function() {
                $(this).dialog("close");
            }
        }
      });
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble displaying the first option in a select element like this: http://jsfiddle.net/L6h9Q/
I am having trouble displaying the jQuery datepicker as shown here: http://jqueryui.com/demos/datepicker/ I believe
This is an employee to dependent relationship. I am having trouble displaying only the
I am having trouble displaying my object in a datalist. My object loks like
I am having trouble displaying to my console to make my results look like
I am having some trouble displaying a div on click using JQuery. All the
I am having trouble displaying this JLabel which contains an image at the specific
I am having trouble displaying results recieved from asp.net WebMethod. I have a HTML
I am having trouble displaying a raw YUV file that it is in NV12
I am having trouble displaying Date s in the format I want in my

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.