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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:12:50+00:00 2026-06-12T20:12:50+00:00

I have a jquery ui dialog which displays a set of buttons in initial

  • 0

I have a jquery ui dialog which displays a set of buttons in initial load(Say ‘Add’ and ‘Close’ buttons). Later when I do something I display another set of Buttons(Say when click on ‘Add’ button I remove existing buttons and display ‘Save’ and ‘Clear’ buttons).
Again when I click on something else I display initial set of buttons.

I’m looking for an easy way to handle this button set switching in my jquery ui dialog.

*Currently Im calling the button definition wherever I wanted, but I think It is not way of doing it. Expecting your suggestions…

jQuery("#myDia").dialog({buttons: [{text:"Add", click: function() { add();}}, {text:"Close", click: function() {close();}}] });

and

jQuery("#myDia").dialog({buttons: [{text:"Save", click: function() { save();}},{text:"Clear", click: function() {clear();}}] });

  • 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-12T20:12:51+00:00Added an answer on June 12, 2026 at 8:12 pm

    You can define your button list in a buttons array. Ex:

    var buttonOpts = {}; buttonOpts["Add"] = function () {
        add(); }; buttonOpts["Save"] = function () {
        save(); }; buttonOpts["Clear"] = function () {
        clear(); };
    

    Then when you want you can change or switch the button list using the option method, like this:

    $("#myDia").dialog('option', 'buttons', buttonOpts);
    

    jQuery UI dialog reference: http://api.jqueryui.com/dialog/#method-option

    Here is a working fiddle: http://jsfiddle.net/nGUrw/6/

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

Sidebar

Related Questions

Problem: Display jquery flot graph in dialog box I have a page which displays
I have the following method in aspx code behind which displays a jquery dialog.
I have a jQuery dialog which loads an external php page. All is working
I have a jquery modal dialog that displays a partial view. The partial view
I got a div tag which initially is set to have display:none and will
I have several Telerik's DropDownList controls which are rendered inside jQuery dialog It is
I have an HTML link that opens a jQuery modal dialog which contains an
I have a jquery dialog box which contains an image (img). I am trying
I have a code snippet of a jQuery Dialog which renders differently in Firefox
I have an ASP.NET website which uses the jQuery dialog to present the user

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.