Calling of the page when body onbeforeunload event is generated

R

ramgaikwad

<script>
function checkFormStatus(oForm)
{
if(isDirty(oForm))
//event.returnValue = "You have entered form Data without
submitting this form.";
{
alert("You have entered form Data without submitting this
form.");
}
else { return true;}
}
var bSubmitted=false;

function isDirty(oForm)
{
if(bSubmitted) return false;
/*var iNumElems = oForm.elements.length;
for (var i=0;i<iNumElems;i++)
{
var oElem = oForm.elements;
if ("text" == oElem.type)
{
if (oElem.value != oElem.defaultValue) return true;
}
}*/
var str;
str=window.document.URL;
str=str.toLowerCase();
if(str.indexOf("orderstatus") > 0)
{
window.self.location.href="http:\\arun54\rameshwargspc\dotedit
\testPrintablePDF.asp";
return false;
}
else
{
return true;
}
}
</script>
<body bgcolor="E6EAF2"
onbeforeunload="javaScript:if(checkFormStatus(document.forms[0]));">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top