Here's my test:

//valid page wrapped around this, latest prototype linked from google.

<form action="" id="foo" method="get" accept-charset="utf-8">
        <p><input type="submit" value="Test"/></p>
</form>
<div><p><a href="#" id="bar">Test Submit</a></p></div>
<script type="text/javascript" charset="utf-8">
        $('foo').observe('submit',function(evt){
                Event.stop(evt);
                console.log(evt.element().id);
                alert(evt.element().id)
                $('foo').submit();
        });
        $('bar').observe('click',function(evt){
                Event.stop(evt);
                $('foo').submit();
        })
</script>

Clicking on the form button fires the alert and reports that 'foo' was  
the event element there and in the console. Clicking on a#bar submits  
the form without passing Go, collecting $200, or anything else  
console- or alert-related happening.

Tested in Firefox 2.latest and Safari 3.latest.

Walter

On Mar 19, 2009, at 3:24 PM, Matt Foster wrote:

>
> Very strange but I'll take your word on it.
>
> Although I can't say I understand why the object wouldn't throw its
> submit event after executing the submit method.
>
> If another method, one that isn't handling the event called the submit
> method, would it be caught by the submit listener?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to