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

  • Home
  • SEARCH
  • 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 3991854
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:39:56+00:00 2026-05-20T06:39:56+00:00

When I use AJAX on date_select the value pass as parameter only the value

  • 0

When I use AJAX on date_select the value pass as parameter only the value that was changed
but I need the values of each field too.

Example

DATESELECT

5 June 2011 => Change to 6 June 2011 but AJAX VALUE only pass in params the value “6”.

I need the day, month and year.

My code
The View
<% form_for(@operation, :url => submit_cancellation_admin_operation_path) do |f| %>
<%= f.error_messages %>

  <p>Fecha de Pago:<br/><br/>
    <%= date_select("", :payment_date,  {:start_date => Time.now - 10}, {:onchange =>"#{remote_function(:url => {:controller => 'operations', :action => "update_payment_date"}, :with => "'payment_date='+value")}"}) %>
  </p>

<%  end  %>

The Controller

  def cancel
    @operation        = Operation.find(params[:id])
    last_pagare       = Pagare.find(:first, :conditions => "operation_id = #{@operation.id} AND state <> 'cancelled'")
    #The condition unless is because the last_pagare could be nil if the operation is totally cancelled 
    @punitive_ammount = @operation.get_punitive(DateTime.now.to_date, last_pagare.expiration_date.to_date) unless last_pagare.nil?
  end

  def update_payment_date
    #Here I take the params 
  end 

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-05-20T06:39:57+00:00Added an answer on May 20, 2026 at 6:39 am

    I use jQuery to solve this problem. best solutions to listen (or read) your suggestions (Excuse I use Google Translate for this phrase).

    <%= date_select("", :payment_date, {:start_date => Time.now - 10}, {:onchange =>"#{remote_function(:url  => {:controller => 'operations', :action => "update_payment_date", :id=> @operation.id},
                                  :with => "'payment_date_1i='+$j('#_payment_date_1i').val()+'&payment_date_2i='+$j('#_payment_date_2i').val()+'&payment_date_3i='+$j('#_payment_date_3i').val()")}"}) %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use ajax to run MySQL query and echo json_encode result, so that I
I am trying to use AJAX for a web app game that im making.
I have many forms that use AJAX (w/ jQuery) for validation and data submission.
yii cactivedataprovider default sorting is specified, but the front desk to use AJAX sorting
I've recently changed my form to use Ajax to submit the data. My form
I'm working on developing a page that pulls data down only via ajax: http://itprojectguide.org/projectmatrix/itprojectguideprojectmatrix.html
We use a DHTML calendar picker that only allows you to change the date,
I use this code to get checked date,but it's not get the int[] value.
In order to use some AJAX calls, we use often some input type=hidden. But
Is this possible to use Ajax.Beginform with update target inside of ajax form. like

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.