Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7870337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:35:27+00:00 2026-06-03T01:35:27+00:00

Working with ajax on a rails 3.1 app, i need to be able to

  • 0

Working with ajax on a rails 3.1 app, i need to be able to submit an ajax form (with remote: true) using a link rather than a submit button.

what do i need to do to the link (or the form) to make it submit as ajax rather than a normal form submit? I have tried adding onclick java to the link, but in each case it simply submits the form in a non-ajax way (page refresh).

The ajax form currently works fine with using a submit button, so it’s got to be something small…

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:35:29+00:00Added an answer on June 3, 2026 at 1:35 am

    When you create a form with :remote => true the Ajax event is bound to the submit button of the form. You must use javascript to trigger that event. Here is some code I used to accomplish something similar:

    <%= form_for [item.list, item], :remote => true, :html => { :'data-type' => 'json', :id => 'change-completed-form' } do |f| %>
        <td><%= f.label :name, item.name %></td>
        <td><%= f.check_box :completed, :onClick => "this.form.submit_button.click();" %></td>
        <%= f.submit :id => 'submit_button', :style => 'display: none;' %>
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my Ajax working, builtin Rails javascript, with the submit button. However, I
I'm on my second app with Rails and I want to get ajax working.
I've got Ajax working on a create action in my Rails 3 app, so
I managed to get Ajax working in Rails, specifically using remote_form_for tag to add
In my current rails app I'm using an ajax uploader library that requires you
I'm working on implementing Ajax-Upload for uploading photos in my Rails 3 app. The
I have a form that is submitted via ajax in a rails 3 app.
I am writing an Ajax request form with Ruby on Rails using a collection_select
I am working on Rails 3.1 Jquery Ajax demo app listed here https://github.com/samnang/ajax_rails31_demo .
Rails 3 app.... I have the following jQuery which is working: $.ajax({ url: '/navigations/sidenav',

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.