# Datepicker array

**URL:** <https://www.ruby-forum.com/t/datepicker-array/165099>\
**Category:** Rails\
**Created:** [April 9, 2009, 3:25am UTC](https://www.ruby-forum.com/t/datepicker-array/165099 "2009-04-09T03:25:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [April 9, 2009, 3:25am UTC](https://www.ruby-forum.com/t/datepicker-array/165099/1 "2009-04-09T03:25:44Z")

</div>

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:

\<%= text\_field\_tag "mopdate[]",nil, :size =\> "14" %\> \<%= text\_field\_tag "start\_time[]",nil, :size =\> "14", :value =\> "00:01"%\> \<%= text\_field\_tag "end\_time[]",nil, :size =\> "14", :value =\> "05:00" %\> \<%= text\_field\_tag "roll\_back\_time[]",nil, :size =\> "14", :value =\> "04:00" %\>

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?

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [April 9, 2009, 4:17pm UTC](https://www.ruby-forum.com/t/datepicker-array/165099/2 "2009-04-09T16:17:02Z")

</div>

OH, it is a FORM, doh. Also the partial may be rendered multiple  
times.
