Two actions in form_remote_tag

Why does this form_remote_tag call generate this form tag with both
“post” and “get” action?

form_remote_tag :url=> events_path, :method => “get”, :html => {:id =>
“search_form”} do

html output.

This is messing up my submissions, when I define a submission on the
event of a select tag in the form changing…with a javascript call
of …this.form.onsubmit(), it works fine. but if I call form
submission from a call back using jquery.

$j("search_form).submit();, it tries to do a post submission which
fails with unauthorized error.

Please help.

Thanks

Hi,

On Wed, Apr 28, 2010 at 5:04 PM, badnaam [email protected] wrote:

if I call form
submission from a call back using jquery.

You should note that the documentation at api.rubyonrails.org explicitly
shows you that ‘action=’ will be part of the generated code. You can
use
the :onsubmit option to call your javascript function. If you insist on
using an event observer, I’d recommend you code your own ajax instead of
having rails do it.

HTH,
Bill

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs