You can modify the buttons using the buttons option setter, but it requires
you to set all buttons at once:
//init
$("#myDiv").dialog({
  buttons: {
    "Ok": function() {
      $(this).dialog('close');
    }
  }
});

//modify buttons after init
$("#myDiv").dialog("option", "buttons", {  "Yes": function() {
    //...
  },
  "No": function() {
    //...
  }
});

You could put each of your sets of buttons in hashes, and then init with
one, and swap one for the other and back:

var createButtons = { ... };
var editButtons = { ... };

$("#myDiv").dialog({ buttons: createButtons });
$("#myDiv").dialog("option", "buttons", editButtons);
$("#myDiv").dialog("option", "buttons", createButtons);

- Richard

On Sun, Aug 2, 2009 at 12:50 PM, Daniel Israel <d...@ebji.org> wrote:

> Hi All,
>
> I am creating an form dialog that will be slightly different for creating
> data than editing data.  I'm pretty new to jquery, but I'm using the
> jqueryui and it seems to be working fine, but now I'm looking to change the
> labels of a couple of buttons and have one button available during editing
> (but not creating).
>
> Hope this makes sense...  Is there a way to do that without having to
> create new dialogs?
>
> Thanks.
>
> -D. Israel
> d...@ebji.org
> http://www.customcodebydan.com
> AIM: JudoDanIzz
>
> If a dozen smart, successful people who've achieved something great are all
> giving the same advice, take it.
>
>

Reply via email to