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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:25:43+00:00 2026-06-10T00:25:43+00:00

My page have multiple dialog boxes. I’ve separate div sections defined for it. Per

  • 0

My page have multiple dialog boxes. I’ve separate div sections defined for it. Per requirement, I’ve to disabled save button in dialog box till all required fields are not populated. Am able to disable it. The problem comes when I open other dialog box. Save button get disabled for those dialog boxes as well.

I can place script to enable button on dialog boxes which I don’t want do that. Do I’ve any other solution to resolve this problem?

Mypage.cshtml

<div id="MyDialg" title="Dialog 1">
</div>

<input id="btnMy" type="button" value="Dialog1" />

MyJs.JS

$('#MyDialg').dialog({
    autoOpen: false,
    width: 400,
    height: 350,
    modal: true,
    resizable: false,
    buttons: {
        "Cancel": function () { $(this).dialog("close"); },
        "Save": function () {
        }
    }
});

$("#btnMy").button().live("click", function () {
    var diag = $('#MyDialg');
    diag.load("Action/Controller", '', function () {
    });

    $(diag).dialog('open');
    return false;
});

Am using below line on load to disable ‘save’ button on dialog:

_MyDialog.cshtml

    $(".ui-dialog-buttonpane button:contains('Save')").button("enable");

Source code (one of dialog html)

<DIV class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" jQuery17205878367688005092="61" sizcache04606232417093721="71" sizset="0"><SPAN id=ui-dialog-title-MyDialg1 class=ui-dialog-title jQuery17205878367688005092="62">MyDialg title</SPAN><A class="ui-dialog-titlebar-close ui-corner-all" role=button href="#" jQuery17205878367688005092="60"><SPAN class="ui-icon ui-icon-closethick" jQuery17205878367688005092="63">close</SPAN></A></DIV> 
<DIV style="MIN-HEIGHT: 0px; WIDTH: auto; HEIGHT: 247px" id=MyDialg1 class="ui-dialog-content ui-widget-content" jQuery17205878367688005092="58" scrolltop="0" scrollleft="0">
<FORM id=form1 method=post action=/action1/controllername jQuery17205878367688005092="172" novalidate="novalidate" data-ajax-success="showSuccessMessage" data-ajax-method="POST" data-ajax="true" data-ajax-failure="showErrorMesage">
<BR>
<DIV class=field><LABEL for=Name>Description: </LABEL><SUP class=mandatory>*</SUP> <INPUT id=Name class="text-box single-line" type=text name=Name> <BR><SPAN class=field-validation-valid data-valmsg-replace="true" data-valmsg-for="Name"></SPAN></DIV><BR><BR>
<HR>
<BR>
</FORM><BR></DIV>
<DIV class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" sizcache04606232417093721="71" sizset="1">
<DIV class=ui-dialog-buttonset sizcache04606232417093721="71" sizset="1"><BUTTON aria-disabled=false class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role=button type=button jQuery17205878367688005092="64"><SPAN class=ui-button-text>Cancel</SPAN></BUTTON><BUTTON aria-disabled=true class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-button-disabled ui-state-disabled" role=button disabled type=button jQuery17205878367688005092="65"><SPAN class=ui-button-text>Save</SPAN></BUTTON></DIV></DIV>
  • 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-10T00:25:44+00:00Added an answer on June 10, 2026 at 12:25 am

    You can target the specific button by using your dialog ID as your starting point. Since I think you what you have in your code above is specific to the dialog you want to enable/disable the button. You can use the following code to find the specific ‘save’ button which will not affect your other dialogs

    $('#MyDialg').find('button:contains("Save")').button('disable');
    $('#MyDialg').find('button:contains("Save")').button('enable');
    

    EDIT:

    There’s 2 ways you can do this. You can traverse your current structure to find it using the following

    1. start from your dialog id
    2. find the main dialog
    3. find span containing the save button text
    4. get the button container and disable it

    the code

    $('#MyDialg').closest('div.ui-dialog').find('span.ui-button-text:contains("Save")').closest('.ui-button').button('disable');
    

    http://jsfiddle.net/wirey00/zDUQX/

    Or you can give your button an id

    buttons: {
        "Cancel": function () { $(this).dialog("close"); },
        "Save": {
            text: 'Save', // <-- text to show
            id: 'test',  // <-- this sets the id to TEST
            click: function () {
                  // code here
            }
        }
    

    then just use the id to disable it

    $('#test').button('disable');
    

    http://jsfiddle.net/wirey00/zf9Wp/

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

Sidebar

Related Questions

I have problem when i tried to invoke multiple dialog boxes in a page.
I have multiple menues on my page... <div class=menu> <div>Menu header</div> <div>Menu content</div>// should
I have multiple pages branching of a title page, and when a back button
I have multiple input fields on my page. I Regex them with a css
I have multiple datepickers in one page. I user class name to set the
I have multiple forms on a page, for each of them I want the
I have multiple input textboxes in my page. I want to reset particular text
I have multiple ajax forms on page that cointain same elemets, I have jquery
I have multiple buttons on a page and I want to simulate a click
I have multiple forms for lots of products on my page and want to

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.