Re: Why is the vBulletin RTE stopping me from preventDefault()?
"John M. Hann" <[email protected]> Wed, 07 Jun 2006 13:41:21 -0000
| Newsgroups | gmane.comp.web.dom.wdf |
|---|---|
| Message-ID | <[email protected]> |
Hi Christian,
Try using the modern methods for attaching events (IE5+, FF1.0+,
Safari1.2+, Opera7+). It is possible that your events are getting
overwritten. (This also relieves your code from the duty of saving any
previous onkeydown events.)
if (element.addEventListener) {
element.addEventListener(name, observer, useCapture);
} else if (element.attachEvent) {
element.attachEvent('on' + name, observer);
}
name = "keydown"
observer is a reference to the event handler function
useCapture: try false first, also try true
Also, try stopping the event propagation in addition to preventing hte
default (unlikely culprit):
if (event.preventDefault) {
event.preventDefault();
event.stopPropagation();
} else {
event.returnValue = false;
}
Regards,
-- John
http://e-numera.com/
http://ajax-web2.com/
--- In [email protected], "lacasseroland" <christian.fecteau@...>
wrote:
>
> I don't understand why the latest RTE of vBulletin boards is stopping
me
> from preventDefault()
>
> It works fine in IE with returnValue, but not in Firefox/Safari/Opera
> where I need to use preventDefault.
>
> Here is a favlet I coded for me to use real tab to indent in textarea
> elements:
>
> page to bookmark the favlet
> <http://www.christianfecteau.com/echo/textedit/textedit_favlet.html>
> link to a forum with the problematic RTE
> <http://www.codingforums.com/showthread.php?t=88384>
>
> If you inject it on a board with the vB editor and press the tab key
in
> FF, the tab character is inserted in the textarea, but the focus is
> given to the next element in the form, which is what preventDefault()
is
> supposed to avoid.
>
> If anyone knows why, please tell me.
>
> Otherwse, I will comment lines of their JS one by one until I find the
> problem.
>
> Thanks.
>
>
> [Non-text portions of this message have been removed]
>
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Protect your PC from spy ware with award winning anti spy technology. It's free.
http://us.click.yahoo.com/97bhrC/LGxNAA/yQLSAA/9rHolB/TM
--------------------------------------------------------------------~->
Unsubscribe
[email protected]
List info
http://www.quirksmode.org/dom/list.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/wdf-dom/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/