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
I use jQuery to solve this problem. best solutions to listen (or read) your suggestions (Excuse I use Google Translate for this phrase).