<HTML>
<HEAD>
<SCRIPT>
function closeIt()
{
if (checkValue())
event.returnValue = "data has been changed, please save it first";
}
function checkValue()
{
var es = document.form1.elements;
for (var i=0; i < es.length; i++)
{
if (es[i].type == "text" && es[i].value != es[i].defaultValue)
return true;
}
return false;
}
</SCRIPT>
</HEAD>
<BODY onbeforeunload="closeIt()">
<form name="form1">
<input name=txt>
</form>
<a href="http://www.microsoft.com">Click here to navigate to
www.microsoft.com</a>
</BODY>
</HTML>
set mylb= myform.fend
for i=0 to mylb.options.length-1
ii=mylb.selectedIndex
next
if myform.fend.selectedIndex<>-1 then
myfend= myform.fend.options(ii).value
else
myfend=1 '末级
end if