Calling aForm.submit() does not get observed by any listeners.  Observe will
listen to the user generated event - a button or img tag, or pressing return
in a text box - but not to a submit() call.  Try observing for click and
submit and stop/forward to a 3rd function that handles the logic, or have
both fire a user event.

-Fred

On Wed, Jun 18, 2008 at 3:30 PM, louis w <[EMAIL PROTECTED]> wrote:

>
> Event listener for a form being submitted is not catching an A tag
> with a submit in it.
>
> Example JS:
>                        $(form).observe('submit', function(e) {
>                                e.stop();
>                                // Something
>                        });
>
>
> Example HTML:
>
> <a href="#" onClick="myForm.submit();">Submit form</a>
>
> Any idea how to fix this without added more js to button?


-- 
Science answers questions; philosophy questions answers.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to