Re: form submit events

Anders Nawroth <[email protected]> Thu, 16 Mar 2006 17:25:30 +0100
Newsgroups gmane.comp.web.dom.wdf
Organization Team Nawroth
Message-ID <[email protected]>
Scott Sauyet skrev:
> Anders Nawroth wrote:
>   
>> Does anyone have a working example of multiple submit event handlers?
>> Any special gotchas when doing stopping form submit events?
>>     
> No, I don't have any such example, but I'm curious as to why you can't 
> call the main event handler from the validation one.  Are these more 
> generic handlers and not specific to these forms?
>   
That's what I'm doing now ...

The purpose is to keep things as modular and generic as possible. The 
less I need to tie different functions up to each other, the better.

Gerry Hornik skrev:
> Can't this simply be accomplished by having the event handler return  
> false? It works for an onclick handler.
>   
Not possible with multiple event handlers on the same object and event.

Ian Petersen skrev:
> I'm pretty sure one event listener can't block another listener on the
> same node and event.  You can only stop the event from bubbling
> further up the document tree.
> ... 
> Then buttonClick1 and buttonClick2 can block divClick from being
> called by doing event.stopPropagation() (or the IE equivalent), but
> buttonClick1 and buttonClick2 are both guaranteed to run in some
> arbitrary order.
>   
OK, now I think I understand how the event bubbling works. I have to 
chain the events to each other in one way or another to stop not wanted 
events from firing (as it is same node and event).

Do I have to account for the event handlers beeing run in *arbitary 
order*? I have not tested this very much, but the events seem to fire in 
the same order they have been attached to the object. But that's maybe luck?

Thanks for your help!

/AndersN


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/