Displaying 1 result from an estimated 1 matches for "onsubmitlistener".
2006 Oct 20
1
Event.observe vs. element.onxxx =
...of using Event.observe vs. element.onxxx =
somefunction ?
I noticed that a lot of sau code doesn''t use Event.observe. For example,
InPlaceEditor uses
this.form.onsubmit = this.onSubmit.bind(this);
In my code I''ve made a habit of using the equivalent (for example):
this.onSubmitListener = this.onSubmit.bind(this);
Event.observe(this.form,''submit'',this.onSubmitListener);
So that in my "dispose" methods I can cleanup properly by calling:
Event.stopObserving(this.form,''submit'',this.onSubmitListener);
Am I just wasting my time? Is...