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

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top