Forum: Ruby on Rails Submit a form_remote from arbitrary JS

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.
Bryan D. (Guest)
on 2006-04-25 06:53
What I want to do is trigger an AJAX form submit from an event handler
for a form element. The form is named, and I tried calling
formname.submit() from the onblur handler. However, instead of using the
settings from the form_remote_tag above it, the form ends up submitting
the whole browser.

I know what you're thinking, why not use an observer? I tried that, and
I ran into some problems. The observe_field call is inside a partial
that gets called through AJAX, and for some reason, IE really isn't
appreciating things like

<%= observe_field ... %>

I get an error way the hell down in prototype.js, says VS.NET debugger.

Does anyone know:
a) how to cause form_remote to actually submit the way its supposed to?
b) how to stop goofball prototype errors when you have scripts in the
returned fragments?

Either of these would work out for me, I think.

This topic is locked and can not be replied to.