logo       

[Rails I18n] AJAX link_to_remote or form_remote_tag: msg#00025

lang.ruby.rails.i18n

Subject: [Rails I18n] AJAX link_to_remote or form_remote_tag

In one of my forms, I have 2 date input fields (start_date and
end_date) each one depending on the other ( need to add/substract
variable period)

I wrote that , but how the methods start_changed or end_changed can
modify the date value to add/sbstract a period before the replacement
of teh corresponding div.. ?

<%= link_to_remote("starting_date", :update => 'dd_enddate', url =>
{:action => :start_changed} ) %>
<span id='dd_startdate'>
<label for="startdate">Booking Start Date</label><br />
<%= text_field "bookings", "startdate", options = {:class =>
'format-d-m-y', :maxlength => "15" } %>
</span>

<%= link_to_remote("starting_date", :update => 'dd_startdate', url =>
{:action => :end_changed} ) %>
<span id='dd_enddate'>
<label for="enddate">Booking End Date</label><br />
<%= text_field "bookings", "enddate", options = {:class =>
'format-d-m-y', :maxlength => "15" } %>
</span>

or should I use a form_remote_tag ? but these 2 fields area already
within a form ... does it matter ?

thanks for your help

joss


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise