Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use Javascript to block IE Security pop-ups

Status
Not open for further replies.

JavaP100

Programmer
May 18, 2006
6
US
Hi,

I have a J2EE web applications that uses JSPs for its user interface. Anytime a user clicks on one of the screen buttons, a Microsoft IE pop-up window pops up saying

"Are you sure you want to navigate away from this page. You may have unsubmitted changes. If you leave this page the changes will be lost. Press OK to Continue or Cancel to stay on the current page"

I do not want this message to pop up. How can I block this within my jsp page?
 
What does the button do? Do you have any onunload events on the page?

If the JSPs are yours, I don't understand why you don't simply search the source for that string, though.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Yes. I did. thx. I used the onClick function within Javascript. and that seemed to block the pop up.
 
You will not find that message in the source.

This is an IE feature to force a modal dialog to protect people who may accidently close a page with a lot of their unsave work in progress.

Here's how:

Code:
<script>
function accept(){

  return '* * Warning - You will lose your updated page contents * * ' ;

  // force msg to modal dialog to accept exit from this page


}
</script>



<body  onbeforeunload="return accept();"  >
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top