using a datepicker on the second row

using a datepicker on the second row

I have a dynamically loaded form with a date field. 

while($recip_rows = mysql_fetch_array($qryRecip,MYSQL_NUM)){

<label><b>Actual Date</b></label><br />
<input type="text" name="date[]" id="date" size="8" value="<?php echo $recip_rows[3]; ?>" class="date" />
      <script>
            $('.date').datepicker({dateFormat: 'd-m-yy'});
      </script>
}

using this code the datepicker will show when the focus is on the second or third row of the output but the selected date won't take. It always updates the first row, so it's always pointing to the first instance of the date[] array.


How do I get the datepicker to keep instep with the date[] array? Thanks in advance.