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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:02:42+00:00 2026-05-24T02:02:42+00:00

My Needs: I am using a jquery modal dialog. I have some buttons on

  • 0

My Needs: I am using a jquery modal dialog. I have some buttons on it. I want to disable one button when It dialog opens but want to enable it after some specific operation.

What i did: I can disable the button by adding this statementjQuery(".ui-dialog-buttonpane button:contains('Issue')").attr("disabled", true).addClass("ui-state-disabled");.

Problem: But now what I want is that when edit button is clicked I perform some action, after performing that action the `Issue’ button become enable.

My code is below.

 jQuery(newdiv).dialog({
    width:500,
    height:275,
    dialogClass:'alert',
    modal: true,
    close: function(event, ui) { jQuery(newdiv).html(''); },
    buttons: {
        "issue":function()
        {

        },
        "Edit":function()
        {
          //here I am opening a new dialogue. When this child dialog is closed I want the `issue` button of parent dialogue to enablee.I have used this statement
          jQuery(this).find(".ui-dialog-buttonset button:contains('Issue')").removeAttr("disabled").removeClass("ui-state-disabled").addClass('ui-state-default');
        },
        "Cancel":function(){jQuery(this).dialog('close');},
    }
});
jQuery(".ui-dialog-titlebar").hide();
jQuery(".ui-widget-content").css({'background':'none','background-color':'#FFFFFF'});
jQuery(".ui-dialog-buttonpane button:contains('Issue')").attr("disabled", true).addClass("ui-state-disabled");
  • 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-24T02:02:43+00:00Added an answer on May 24, 2026 at 2:02 am

    There’s no need to mess around with the classes on the buttons and it probably isn’t a good idea anyway. The buttons in a jQuery-UI dialog are jQuery-UI buttons and they support disable and enable methods in the usual jQuery-UI style:

    $button.button('enable');  // Enable the button
    $button.button('disable'); // Disable the button
    

    First of all, replace this:

    jQuery(".ui-dialog-buttonpane button:contains('Issue')").attr("disabled", true).addClass("ui-state-disabled");
    

    With this:

    jQuery('.ui-dialog button:nth-child(1)').button('disable');
    

    Then, in your edit handler, do this:

    jQuery('.ui-dialog button:nth-child(1)').button('enable');
    

    To enable the button.

    As far as the selectors go, the main dialog <div> has a ui-dialog class so we start off with .ui-dialog. Then, we want the buttons inside the dialog so we’re looking for <button> elements; this gives us .ui-dialog button. The buttons in the dialog are listed from left to right in the same order as in the buttons option to the dialog. There are various ways to get the first button:

    • :first-child
    • :first
    • :nth-child

    I went with :nth-child which is a CSS3 selector:

    The :nth-child(an+b) pseudo-class notation represents an element that has an+b-1 siblings before it in the document tree, for any positive integer or zero value of n, and has a parent element.

    So button:nth-child(1) is the first button. I figured that if you were doing things to one button, you’d probably end up doing things to other buttons so, for example, you could do .ui-dialog button:nth-child(2) to get the “Edit” button and that would line up nicely with the selector used for the “Issue” button.

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

Sidebar

Related Questions

I have a issue with Jquery Modal dialog being called from a button inside
I'm using the jQuery UI modal dialog, and populating it with some form fields.
I am using jquery UI's dialog widget to render a modal dialog in my
I have a problem with using jQuery Dialog and Ajax submit in JSF. I
I am using jquery UI modal dialog with smoothness theme. It works fine except
I'd like to use jQuery's dialog to replace some code I'm using right now
I have a modal window using jqmodal. I need a button within that modal
I'm using jQuery UI dialog. I have a delete form as follows: @using (Ajax.BeginForm(DeleteUser,
I want to show a popup screen on my page using JQuery UI Dialog
I have this function that I'm using to open a modal dialog that 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.