Hi, window.prompt("statements") return type isn't bool. OK == "undefined", Cancel == "null". In dialog, it will judge the return value with false use option "===", so the dialog is closed.
Code set for option beforeclose: beforeclose:function(){return window.prompt("sure close?") != null;}, 2009/12/17 Obi1 <gurreiro_fa...@yahoo.com.br> > 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. > > I allready tried callign the prompt on "close" event and then return > true or false according to the choosen option but the prompt only > shows after dialog is closed; > Tried the same with "beforeclose" event but the prompt doesn't even > show. > > any ideas? > > Thanks > > -- > > You received this message because you are subscribed to the Google Groups > "jQuery UI" group. > To post to this group, send email to jquery...@googlegroups.com. > To unsubscribe from this group, send email to > jquery-ui+unsubscr...@googlegroups.com<jquery-ui%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/jquery-ui?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery...@googlegroups.com. To unsubscribe from this group, send email to jquery-ui+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.