Forum: Ruby on Rails [Prototype] Why doesn't calling submit() on a form result in

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
BigSmoke (Guest)
on 2006-05-09 15:14
(Received via mailing list)

Is it normal that a call to $('some_form').submit() doesn't result in
execution of an onsubmit event handler on 'some_form'?


  - Rowan
Jonathan V. (Guest)
on 2006-05-09 16:16
(Received via mailing list)
It's just how forms work. The equivalent of clicking the submit
buttons is something more like:

if ($('my_form').onsubmit()) $('my_form').submit();

When submitting a form with Ajax, onsubmit serializes the form,
initiates the remote request and returns false. submit() is never run.

BigSmoke (Guest)
on 2006-05-09 18:42
(Received via mailing list)
I should have (but hadn't) realized that I could simply run
$('my_form').unsubmit() myself.

Thanks for kindly pointing me where I should have looked in the first

  - Rowan
This topic is locked and can not be replied to.