I think onbeforeunload always runs, obviouslu onunload only runs if onbeforeunload does not cancel it. Why not just use onbeforeunload? Otherwise have a global Boolean variable, hasValidated, that you set in onbeforeunload. Then check its value in onunload before validating a second time.
--
Joe (
Microsoft MVP - XML)