Hi I have looked through other posts, which has been marked as correct – and are the same as what I ave been trying. BUT for some reason I cannot get more than one instance of datepicker to work on my pages. Could anyone think of a reason why as there is no problems in the error console.
$('.hasDatepicker').each(function(){
$(this).datepicker({autoSize: true,dateFormat: 'dd-mm-yy'}); // new doesn't work
});
$('#notedate').datepicker({autoSize: true,dateFormat: 'dd-mm-yy'}); // original - works
and the HTML
<input type="text" name="dob" id="dob" class="inputText hasDatepicker">
No need to give
.each. This should workThe above code wont work because hasDatepicker is a class that jQuery UI automatically assigns the inputs.
Please change the class name to something like
Demo: http://jsfiddle.net/PaGmj/