DatePicker with multiple inputs with the same ID?
I've got a form where I add additional elements for a date range based
on user input.
So, simple case:
<div id="SomeGroup1">
<input name="fStartDate" id="fStartDate" />
<input name="fEndDate" id="fEndDate" />
</div>
<div id="SomeGroup2">
<input name="fStartDate" id="fStartDate" />
<input name="fEndDate" id="fEndDate" />
</div>
...and so on. When I bind the datepicker like this:
$("#SomeGroup2").find("#fStartDate,#fEndDate").datepicker();
I get separate calendars for each of the four fields but when I switch
months using the arrows on the calendar for a field in SomeGroup2, the
calendar gets redrawn next to the corresponding field in SomeGroup1.
Any way to avoid this without having to change the IDs of the date
fields?