how to check if user has closed the dialog by clicking on cross icon in jquery UI dialog -


i have 2 dialog boxes. user selects value in first 1 , reflected in dom of page. first dialog box closed , displayed. if user clicks on cross button in right hand top corner close dialog, want revert changes made in previous dialog box. on ok button, have stuff setting values. on button, i'm closing dialog. on close event, till have code reset form. but, if user cancels dialog box, how know, how close event triggered i.e. ok button or cross button ?

you can find "x" button it's class, .ui-dialog-titlebar-close, attach click handler when creating dialog, this:

$("#test").dialog({     //dialog options... }).parent().find(".ui-dialog-titlebar-close").click(function() {     alert("closed title bar x, clear other form here"); }); 

you can test here.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -