Hey all,
Tried this on the IRC channel but after an hour i figured nobody that
was on knew, so i’ll try it here. I have a rhtml page with:
<% remote_form_for(:performance_goal, :url =>
user_performance_goal_path(@user.account, @user,
@performance_goal), :html => {:id => ‘sidebar_form’, :method => :put})
do |f| %>
<%= f.text_area :impact, :size => ‘25x3’, :onchange =>
“this.form.submit();” %>
<% end %>
please know that the :method => :put is in there to send the request
to my RESTful update method. When i change the text area it does in
fact submit the form, but not through AJAX. Instead it sends it as a
normal html form and ignores the onsubmit attribute which reads:
onsubmit=“new Ajax.Request(’/accounts/1/users/1/gss/performance_goals/
1’, {asynchronous:true, evalScripts:true,
parameters:Form.serialize(this)}); return false;”
Ive tried using the observe_form helper and it behaves the same way.
The only way i can have it submit through AJAX is by using a submit
button. How can i submit the remote_form_for form via javascript and
have it still perform the AJAX request?
Thanks!