Handle the beforeclose event and return false if you don't want to allow the dialog to close yet:
http://docs.jquery.com/UI/Dialog#event-beforeclose If you have any further questions, there's a separate list for questions about jQuery UI plugins: http://groups.google.com/group/jquery-ui - Richard On Thu, Dec 17, 2009 at 5:10 AM, Obi1 <gurreiro_fa...@yahoo.com.br> wrote: > Hi, i'm having some trouble because i'm using a dialog witch has a > form in it where someone can change info about their hotel. this > dialog also has 2 buttons one to close and the other to save changes. > what i'm trying to accomplish is - when someone made sany change and > tries to close de dialog without saving he will be prompt if he really > wants to leave without saving the changes an the dialog only closes if > person choses 'yes'. > > when closing the window clicking the 'close' button i can accomplish > this, but i wanted it also to work when closing dialog using the "x" > button on the top of the dialog. > > is this possible? >