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 8043265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:50:55+00:00 2026-06-05T04:50:55+00:00

I am developing on Rails 3.0.3 and using jQuery. Here is my javascipt include

  • 0

I am developing on Rails 3.0.3 and using jQuery. Here is my javascipt include tag:

<%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", "rails.js" %>

I want to send a JS request on change of a dropdown and wrote the following code to do so. This form does not get processed as JS, but is getting processed as an HTML request instead:

<% form_tag(aggregatedata_path, :method=>'post', :id => "dd-container", :remote => true ) do %>
    <%= select_tag( 
        :group, 
        options_for_select(groups_list, @group), 
        {
            :id => "dd", 
            :onchange => "this.form.submit();"
        } ) %>
<% end %>

I read a similar post on SO that suggested the problem was the js library, but unless there’s no other way, I’d rather avoid changing that at this point lest a million other things break. I have another form that gets processed as a JS request just fine. Here it is:

<% form_tag(poweroutput_path, :method=>'post', :id => "date-form", :remote => true ) do %>
    <%= text_field_tag(
        'dt', nil,
        {  
            :id => 'date-field',
            :class => 'dateformat-d-dt-m-dt-Y',
            :value => Time.now.getlocal.strftime("%d.%m.%Y")             
        }) %>
    <%= submit_tag " ", :id => "go-button" %>
<% end %>

The only obvious difference I see is that the first one uses :onchange => "this.form.submit();" while the second does not. Is there something in that function that overrides my earlier :remote => true?

  • 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-05T04:50:57+00:00Added an answer on June 5, 2026 at 4:50 am

    I agree with Dave. Since you are already using jQuery, I’d go with something like this:

    $('#dd-container').change(function(){
      $.ajax({
        type: "POST",
        url: your_path,
        data: $(this).find('option:selected').attr('value'),
        success: function( response ) {
          console.log( response );
        }
      });
    });
    

    Oh, and don’t forget to remove the :onchange => "this.form.submit();" and , :remote => true from your form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a Rails app using OmniAuth, OmniAuth-salesforce and this gem: https://github.com/heroku/databasedotcom I
I am a newbie developing using rails and jquery and having been searching everywhere
I am developing an app using Rails and jQuery. I would like to submit
I'm developing a web-app in Rails using jQuery where a lot of the processing
I am developing an autocomplete form using JQuery and Rails. However I don't know
I am developing a web app (using rails) that I will be launching within
I'm developing a Rails 3.0 application and am using OmniAuth + Identity for authentication
I am presently developing a web service using Ruby on Rails. I wish to
I'm developing a rails 3.0.9 app, I'm using accept nested attributes for to add
I am developing a facebook application in Ruby on Rails using MongoDB as database.

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.