UI: Dialog: Form: Add a Button with an ID?

UI: Dialog: Form: Add a Button with an ID?

 Hi guys and gals,

could someone please tell me how to include an ID on a button when adding it to a modal dialog form?

The closest I've got is to by using a css selector:

   
  1.  $('.ui-dialog-buttonpane button:eq(0)')

but this seems to get broken when closing and reopening the dialog.

Any help will be very appreciated.


I have the following code.

   
  1.  $('#dialog').dialog({
  2.     bgiframe: true,
  3.     // ...
  4.     buttons: {
  5.         'Save': saveData,
  6.         Cancel: function()
  7.         {
  8.             $(this).dialog('close');
  9.         }
  10.     }
  11.     // ...
  12. })