Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

java script problem

 
kanumuri koti
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi everyone

I have a data grid and 2 buttons on a page, when a user cancels the window, i want to displat a popup asking the whethere they are sure they want to cancel.

i currently have

<SCRIPT>
function SaveChanges()
{
event.returnValue = "You will loose all unsaved changes, please update details before closing the window.";
}
</SCRIPT>



i call this function on the body like

<body bgColor="#ffffff" MS_POSITIONING="GridLayout" onbeforeunload="SaveChanges()">



Problem is, this message comes up even when clicking the buttons on the page, which is wrong, i want it to happen only when the user closes/cancels the window. Please help
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Moving to JavaScript forum...
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post in multiple forums....

Closing this topic: Post continues here: http://www.coderanch.com/t/119150/HTML-JavaScript/java-script

Eric
 
    Bookmark Topic Watch Topic
  • New Topic