views:

397

answers:

2

I am registering a function with the onload method of a html form, I need to unregister this event hander function on unload of the form. How do I do it in Internet Explorer 6?

+3  A: 

Use detachEvent

Reference

Greco
+5  A: 

if you have added the onload in your HTML or via JavaScript

<form onload="blah()">

or

myForm.onload = blah;

then

myForm.onload = null;

should do it
if you've used attachEvent

myForm.attachEvent( 'onload', blah );

use

myForm.detachEvent( 'onload', blah );

EDIT
I'm not sure forms have onload events tho, are you sure?

meouw