Hi Shadraq,
Try this:
$("#myDlg").dialog({
modal: true,
buttons:
{
"Submit": function() { /* submit code goes here */ },
"Cancel": function() { $(this).dialog("close"); }
},
close: function(ev, ui) { /* cancel code goes here */ }
});
If you are closing the dialog on the submit button too, you will need
to write something to not fire the cancel code in the close event.
Hth,
Dave
Shadraq wrote:
> I am running into an odd issue. I have a UI modal dialog box that asks
> the user to "Submit" or "Cancel". Both buttons unleash various
> actions.
>
> The problem I am running into is when the user closes the box by
> clicking "x" on the top right of the box, rather than "Cancel". No
> actions are unleashed when that happens. I have implemented
> closeOnEscape:false to remove that option, but I am wondering if:
>
> a) the "x" can be removed,
> or
> b) the "Cancel" actions can be assigned to the "x" (preferable option)
>
> Thanks for you time,
> Shadraq
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---