I'm facing a little problem with my jQuery UI datepicker. The thing is, I have my page and some input like this :
blabla | blabla | .date-picker | blabla
blabla2 | blabla2 | .date-picker | blabla2
blabla3 | blabla3 | .date-picker | blabla3
So the 'blabla' are just some text, and the '.date-picker' is an input, with the 'date-picker' class.
In my JavaScript code I have just the following :
$(function() {
$('.date-picker').datepicker();
});
But for example, if I click on the input of the line "blabla3", instead of updating the right input, it always updates the first one...
My input have all the same id (I can't change it), but I'm using the class of the input for my selector, so it should work but doesn't.
Hello old post but it's for those who are still facing this problem...
Just remove the id
of the new input, datepicker always generates a new id i.e. if the input doesn't have one. If it had one the datepicker would keep that, which mean here the first input was cloned and the last will also be updated.
You should change the id of your inputs, else it will not work, because, when you select any date, it use DP_jQuery_1347006322116.datepicker._selectDay('#same',8,2012, this);return false;
this function to selectDay, and it is taking the id for the input.
so if you have multiple id, it will select first input and set the day there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With