I am using Rails UJS. I have a form to do remote submit as follows:
<form accept-charset="UTF-8" action="/subscriptions" class="new_subscription form-horizontal" id="new_subscription" data-remote="true" data-type="json" method="POST">
I am trying to find a way to submit this form from a JavaScript function. I tried:
var form$ = $("#new_subscription"); form$.get(0).submit();
but the problem is that it submits the form without the remote, it submits to the server and refreshes the page. Any idea why this is? Is there a way to submit a remote form?
thanks
jquery ruby-on-rails ruby-on-rails-3 ujs
Anapprentice
source share