Link to home
Start Free TrialLog in
Avatar of RNithik
RNithik

asked on

Display confirmation box with yes or no option before closing dialog window in jquery

I have a close button on my jquery dialog window, when I click on this, we should show confirmation box with message "Do you want to close this window " (Yes/No options) if user selects "Yes" then we need to close the dialog, if user selects "No" it should n't close the dialog and stays as it is..

How we can write this ?

Thanks for everybody's help here.

Thanks
Nithk
Avatar of Gary
Gary
Flag of Ireland image

In your close code

r=confirm("Are you sure you want to close this?");
if(r==true){ 
// Close
}
else {
return;
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Please explain the B grade. See here for how to grade the solutions
http://support.experts-exchange.com/customer/portal/articles/481419-what-grade-should-i-award-
Avatar of RNithik
RNithik

ASKER

can you change it to A grade.. now i understand how grade it works.

Thanks
RNithik.