I have discovered (minor) issue with jQuery Datepicker plugin:
Here is a sample code:
<div class="someWidget"> <input id="myId" class="datepicker"/> </div> .... <div class="someOtherWidget"> <input id="myId" class="datepicker"/> </div>
This will add datepickers on both input fields, and when they gain focus, widget will be displayed (that’s default behaviour). So far so good. But if you click on any date, it will be passed set in the first field and the first field only. Even if datepicker is displayed below the second field, the value will never be passed to it.
Why does this happen? Because of id. Datepicker uses it internally to know to which input field the date should be passed to. If you don’t supply the id in html, then datepicker will come up with its own unique id. But it will never overwrite id, if it is already set.
Hope this will help someone, it took me some time to find out what was happening.
If your datepickers share same id, and one of them is hidden, you may even get this exception: “cannot set property ‘currentDay’ of undefined”. I wanted to show it in a demo, but for some reason I was not able to reproduce it, probably there was something more involved than just ids.