doctororange
doctororange

Reputation: 11810

how to execute a JS function before AJAX request is initiated with remote_form_for

Before my form initiates an AJAX request, I want to call a function.

I see that for link_ to_remote there is the handy :before option... "Called before request is initiated."

here is my source:

<% form_remote_for(@news, :url => {:action => 'create'}) do |f| %>

Before the request is initiated, I want to call myFunction()

Thanks for the help :)

Upvotes: 1

Views: 194

Answers (1)

doctororange
doctororange

Reputation: 11810

My mistake - :before does work with remote_ form_for. I just had a silly syntax error.

Upvotes: 1

Related Questions