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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:26:14+00:00 2026-06-14T10:26:14+00:00

Overview: A basic jqueryui dialog is defined and later opened on demand with injected

  • 0

Overview: A basic jqueryui dialog is defined and later opened on demand with injected markup.

Problem: The first example works, but the second one (seemingly similar) doesn’t. It makes no difference in what order they are opened. Even if I open the non-working one first, it doesn’t work. I would appreciate a second pair of eyes to see if I’ve done something obviously obtuse.

Note: These are snippets from a large code field, so pls don’t check for matching parentheses. All code is working except for the 2nd jqueryui dialog surrounded by asterisks. Ajax returns the correct data, etc. The alert above the 2nd dialog even works, but that dialog never displays (with or without the alert in the code).

The 2nd dialog call is inside an ajax callback function. Do I need to use the .on() method somehow to bind the returned data to the #alert div? (I shouldn’t think so… the div at least — an empty dlg box — should display, no?) If so, what would that look like?

HTML:

<div id="alert" title="Alert"></div>

JAVASCRIPT:

$(function() {
    $( '#alert' ).dialog({
        autoOpen:false,
    });

$(document).on('click', '.mledit', function(event) {
    //company_id is actually the user_id
    var user_id = this.id.split( 'editcopro_' )[1];
    $.ajax({
        type: "POST",
        url: "ajax/ax_all_ajax_fns.php",
        data: 'request=edit_company_data&user_id='+user_id,
        success:function(data){
            $('#co_label').html(data);
            $('#co_label').dialog({
                autoOpen: true,
                height: 600,
                width: 800,
                modal: true,
                buttons: 
                    {
                    //***************************************
                    //******** THIS WORKS *******************
                        Test: function() {
                            $( '#alert' ).html( 'Hello there' );
                            $( '#alert' ).dialog( 'open' );
                            return false;
                    //***************************************
                        },
                //... etc ...
    $.ajax({
        type: "POST",
        url: "ajax/ax_all_ajax_fns.php",
        data: 'request=index_list_contacts_for_client&user_id=' + user_id,
        success: function(data) {
            $('#contact_table').html(data);
            var tbl = $('#injected_table_of_contacts');

                $(this).dialog({
                    autoOpen: false,
                    height: 400,
                    width: 600,
                    modal: true,
                    buttons: 
                        {
                            Okay: function() {
                                $.ajax({
                                    type: "POST",
                                    url: "ajax/ax_all_ajax_fns.php",
                                    data: 'request=update_edited_contact_data&contact_id='+contact_id+'&fn='+fn+'&ln='+ln+'&em='+em+'&cp='+cp,
                                    success: function(data) {
                                        alert(data);
                                    //**********************************
                                    //***** THIS DOES NOT: *************
                                        $( '#alert' ).html( data );
                                        $( '#alert' ).dialog( 'open' );
                                    //**********************************
                                        window.location = '' //THIS LINE AUTO-CLOSES THE DLG!;
                                    }
                                });
                                $( this ).dialog( "close" );
                            } //END ELSE
                        },
                        Cancel: function() {
                            $( this ).dialog( "close" );
                            window.location = '';
                        }
                    } /*,
                    //IMPORTANT DISCOVERY: Having this close section AUTO-CLOSES the prev dialog popup!
                    close: function() {
                        //alert('here i am');
                        window.location = 'index.php';
                    }*/
            })
        }
    });



});
/*********** >Snip< *************/

The full code is huge(r) so I’ve snipped the necessary bits for the question. Please don’t look too closely for matching parentheses, etc. The alert() works fine, it’s just the .dialog() call — and just the 2nd one — the earlier ones work fine (including the dialog call from inside a 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-14T10:26:15+00:00Added an answer on June 14, 2026 at 10:26 am

    SOLVED. See the two places in the code where I commented the solution. Who’d a thunk?

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

Sidebar

Related Questions

Overview I have a Microsoft Word Add-In, written in VBA (Visual Basic for Applications),
A basic overview of my app. There is currently two models. A jobs model
basic overview... i have a site setup in iis... - mysite (wwwroot\mysite) under that
Here's a basic overview of my domain: a user has a list of courses
Overview I am trying to create a very basic scraper with PhantomJS and pjscrape
I'm looking at restructuring a large Maven project... A basic overview of our current
Overview: I'm working on some windows service using Visual Basic 2010, which deployed on
I am having a very basic problem in IE7 that I cannot seem to
I'm using the jQuery validate plugin. I have this code: $(.btn-overview-basic-save).click(function(e) { if (!$('.contact-overview').valid())
The following is a basic striped down overview of one of my projects. I

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.