[thelist] IE form event registration

Chrome admin at chrome.me.uk
Wed Jan 14 05:54:37 CST 2009


Hi all

I'm having a bit of an issue with a form in IE... I have to attach an
onSubmit event handler that doesn't interfere with the existing event
attached to it... I thought I'd use addEventListener/attachEvent to achieve
this and used the following code:

try {
   document.checkout_success.addEventListener('submit', _validate, false);
} catch (e) {
   document.checkout_success.attachEvent('onsubmit', _validate);
} finally {
   // not decided what to do here
}

In Opera and FF this works perfectly but in IE I get an error stating that
the object doesn't support this method or property

I've used the DOM registration models before with no issues but never for a
form

Does anyone have any advice or info on this?

Cheers in advance

Dan




More information about the thelist mailing list