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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:11:39+00:00 2026-05-14T05:11:39+00:00

So, the goal is to confirm switching to another UI tab using UI Dialog

  • 0

So, the goal is to confirm switching to another UI tab using UI Dialog plugin.
Using common confirm method is simple:

jQuery("#tabsContainer").tabs({
    select: function(event, ui) {
        return confirm("Some confirmation message...");
    }
});

but how to to achieve same behavior using Dialog modal box?

I think I have to call:

jQuery("#tabsContainer").tabs("select", ui.index);

on the “ok callback” but this is not working as I expected. Also – there are no errors being reported…

jQuery("#tabsContainer").tabs({
    select: function(event, ui) {
        jQuery("#dialogContainer").dialog({
            buttons: {
                'Ok': function() {
                    jQuery("#tabsContainer").tabs("select", ui.index);
                },
                Cancel: function() { return; }
            }
        });
        return 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-05-14T05:11:40+00:00Added an answer on May 14, 2026 at 5:11 am

    The source of your problem is that window.confirm is blocking and jQuery UI’s dialog is not. You can get around this by structuring your code differently. Here’s one of many possible approaches:

    $(function() {
        jQuery('#tabsContainer').tabs({
            select: function(event, ui) {
                // only allow a new tab to be selected if the
                // confirmation dialog is currently open.  if it's
                // not currently open, cancel the switch and show
                // the confirmation dialog.
                if (!jQuery('#dialogContainer').dialog('isOpen')) {
                    $('#dialogContainer')
                        .data('tabId', ui.index)
                        .dialog('open');
                    return false;
                }
            }
        });
    
        jQuery('#dialogContainer').dialog({
            autoOpen: false,
            buttons: {
                'Ok': function() {
                     // a new tab must be selected before
                     // the confirmation dialog is closed
                     var tabId = $(this).data('tabId');
                     $('#tabsContainer').tabs('select', tabId);
                     $(this).dialog('close');
                 },
                 'Cancel': function() {
                     $(this).dialog('close');
                 }
            }
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Goal : Our application is built using multiple types (e.g. Person, PersonSite(ICollection), Site -
goal : I want to place a text after the submit button using hook_form_alter.
I'm Using Rails3 and the Unobstrusive Javascript Gem jquery-rails . Remote deletion (without page
I'm trying to renew my company intranet using jquery, ajax and php. General aspect
I have some trouble using an Ajax query in a Rails + JQuery ecosystem.
Goal: To render a google map using geolocation. I am trying to implement the
I am using Netbeans 7 with Maven 2.2.1 and jaxws-maven-plugin 1.12. Code is deployed
Goal: Create Photomosaics programmatically using .NET and C#. Main reason I'd like to do
I am implementing a project with Selenium 2, which currently doesn't support confirm dialog
Goal: to programmatically determine the sizes (in bytes) of the fields of a class.

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.