Is there a way to exit out of the window.close() event if a variable is null and prevent a window from closing? I have a modal dialog that I want a user to select yes or no. I want to display a custom message that needs to be in HTML format, so I cannot use the confirm function. Any ideas?