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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:24:46+00:00 2026-06-18T14:24:46+00:00

I want to use the same jquery ui dialog box for mulitple purpose. In

  • 0

I want to use the same jquery ui dialog box for mulitple purpose.

In this case I have a datagrid with checkbox on every row. User can delete the rows which he checked by pressing a button (delete). Whenever button is pressed, a jquery ui dialog box is shown (confirm box) containing message like do u want to delete ? Yes or No

But when there are no checkbox checked and the user presses the delete button, I want to display jquery ui dialog box with different title and msg (No rows selected) in the content. How can I do this ?

Currently my code looks like this:

 $(document).ready(function() {
            $( "#dialog" ).dialog({
                autoOpen: false,
                width:"400px",
                modal: true,
                resizable: true,
                buttons: [
                    {
                        text: "Yes",
                        click: function() {
                            $('#form_list_action').submit();
                        }
                    },
                    {
                        text: "Cancel",
                        click: function() {
                            $( this ).dialog( "close" );
                        }
                    }
                ]
            });
            $( "#action-delete" ).on('click', function(event) {
                event.preventDefault();
                $( "#dialog" ).dialog( "open" );

            });



<div id="dialog" title="Delete Selected Items">
 <p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;">   </span>These items will be permanently deleted and cannot be recovered. Are you sure?</p>
</div>

 <a href="" class="action-delete" id="action-delete">Delete</a>
  • 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-18T14:24:47+00:00Added an answer on June 18, 2026 at 2:24 pm

    I am using this function to create dynamically a dialog box when I need one.

    function showPopup(title,url,height,width,data,showCloseBtn)
    {
        showCloseBtn = showCloseBtn || false;
        height = height || 'auto';
        width = width || 'auto';
    
        //Create popup container if needed or remove content
        if($('#popup').length == 0)
            $('body').append('<div id="popup"></div>');
        else
            $('#popup').empty();
    
        //Reset dialog widget if needed
        try{$('#popup').dialog('destroy');}catch(e){}
    
        if(showCloseBtn)
            btnCode = {"Fermer": function(){$( this ).dialog( "close" );}}
        else
            btnCode = null;
    
        //Load content if the data provided is html code
        if(url.search('<') >= 0)
        {
            $('#popup').html(url);
            $('#popup').dialog({
                    resizable: false,
                    modal: true,
                    width: width,
                    height : height,
                    buttons:btnCode,
                    title : title
                });        
        }
        else
        {
            var data = data || {};
            //Load data from url
            $('#popup').load(url,data,function(){
                $(this).dialog({
                    resizable: false,
                    modal: true,
                    width: width,
                    height : height,
                    buttons:btnCode,
                    title : title
                });        
            });                           
        }    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 Jquery Dialog box on the same page. The look and feel
I have a global form which I want to use the same form every
i want to use focus function in jquery to return to same area of
i have a variable $cartTotal in cart.php page i want to use that same
I have jQuery function that adds a dynamicly, and when i want to use
I have few divs on a page with same class. I want to use
I have a legacy website using Prototype. But I want to use JQuery in
I want to use the jQuery file uploader , and followed this sample [Complete
I use ASP.NET and jQuery and i use a Dialog. In this Dialog I
I want to use jquery dialog with my custom buttons but I don't want

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.