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.
41165a7e7126d616a0ae0762e00718e2?d=identicon&s=25 BigSmoke (Guest)
on 2006-05-09 13: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
631d1677786f0725da6ccee46043686e?d=identicon&s=25 Jonathan Viney (Guest)
on 2006-05-09 14: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.

41165a7e7126d616a0ae0762e00718e2?d=identicon&s=25 BigSmoke (Guest)
on 2006-05-09 16: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.