JQuery Datepicker for multiple .NET MVC Input Fields not working
I have simplified my work for this question but the same problem remains. I am using the Textbox HTML helper to display empty textboxes as I loop through the items in this model.

    <% foreach (var item in Model) { %>

    <tr>
    <td><%: item.ID %></td>
    <td><%: Html.TextBox("usernames", null, new { @class = "datepicker" }) %></td>
    <td><%: item.Password %></td>
    <td> <%: item.Race %></td>
    </tr>
    
    <% } %>

Because I have several rows this produces several <input> fields all with the class "datepicker". I am applying the following JQuery for the datepicker:

    $(document).ready(function () {
    $('input').filter('.datepicker').datepicker({
    dateFormat: "dd/mm/yy",
    onSelect: function (value, date) {
    alert(this.value);
    }
    });
    });

When the page renders, every textbox creates a calendar as expected but it always puts the date into the textbox on line one. I need the date to go into the textbox the calendar appeared next to.

Please Help!

JQuery Datepicker for multiple .NET MVC Input Fields not working
===

I have simplified my work for this question but the same problem remains. I am using the Textbox HTML helper to display empty textboxes as I loop through the items in this model.

    <% foreach (var item in Model) { %>

    <tr>
    <td><%: item.ID %></td>
    <td><%: Html.TextBox("usernames", null, new { @class = "datepicker" }) %></td>
    <td><%: item.Password %></td>
    <td> <%: item.Race %></td>
    </tr>
    
    <% } %>

Because I have several rows this produces several <input> fields all with the class "datepicker". I am applying the following JQuery for the datepicker:

    $(document).ready(function () {
    $('input').filter('.datepicker').datepicker({
    dateFormat: "dd/mm/yy",
    onSelect: function (value, date) {
    alert(this.value);
    }
    });
    });

When the page renders, every textbox creates a calendar as expected but it always puts the date into the textbox on line one. I need the date to go into the textbox the calendar appeared next to.

Please Help!
