Forum: Ruby on Rails datepicker array

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8133ee52ca72188132b5c7d97dfb967f?d=identicon&s=25 Chris Habgood (chabgood)
on 2009-04-09 03:25
(Received via mailing list)
I have a from that will require multiple dates and or times.

I am using the jquery datepicker that I have been using for a long
time.

I am doing this in a partial for multiple date/times:

<td><%= text_field_tag "mopdate[]",nil, :size => "14" %></td>
<td><%= text_field_tag "start_time[]",nil, :size => "14", :value =>
"00:01"%></td>
<td><%= text_field_tag "end_time[]",nil, :size => "14", :value =>
"05:00" %></td>
<td><%= text_field_tag "roll_back_time[]",nil, :size => "14", :value
=> "04:00" %></td>

I have this for the initialize method:
jQuery(document).ready(function($){
  $('#mopdate[]').datepicker({ dateFormat: 'yy-mm-dd' });
  $('#start_time[]').timePicker({step: 15, startTime: "00:01", endTime:
"05:00", columns: 5})
  $('#end_time[]').timePicker({step: 15, startTime: "00:01", endTime:
"05:00", columns: 5})
  $('#roll_back_time[]').timePicker({step: 15, startTime: "00:01",
endTime: "05:00", columns: 5})
});

None of em appear to work.

Is there a way to get something like this to work?
8133ee52ca72188132b5c7d97dfb967f?d=identicon&s=25 Chris Habgood (chabgood)
on 2009-04-09 16:17
(Received via mailing list)
OH, it is a FORM, doh.  Also the partial may be rendered multiple
times.
This topic is locked and can not be replied to.