Is there a way to jump to a web home page when the escape key is pressed on a modal dialog box? Below is the modal dialog box I am using:
<script>
$(function () {
$("#dialog-login-message").dialog({
modal: true,
buttons: {
Ok: function () {
document.location.href = "/";
$(this).dialog("close");
}
}
});
});
</script>
<div id="dialog-login-message" title="Login Required">
<p>
<span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
You are not logged into this website. You need to be logged into this website to use the demo.;
</p>
</div>
If a user is not authenticated this dialog appears. If they press OK it takes them to the home page. But if they press the escape key the dialog is passed by and the view continues to become available. I would like to send the user back to the home page but I'm not sure how from here. Thanks in advance.