Rails 3: How to trigger a form submission via javascript? -


i have form part submits normal form, don't want set in form_tag :remote => true option.

however, under circumstances i'd able have javascript function post form if had been posted :remote => true. need in javascript accomplish this?

i tried works, if form has remote => true, remove data-remote attribute submit w/ javascript ie

$('input').click(function(){ $('#form').removeattr('data-remote') }); 

i'm guessing opposite work ie if form doesn't have remote => true do

$('input').click(function(){ $('#form').attr('data-remote',true)}); 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -