At the moment in my JS I statically define which input ID's I want to associate my datepicker script with.
Like so:
$('datepicker1').glDatePicker();
However to make this dynamic I have refactored this into a for loop so that for multiple fields that need a datepicker I can call them in that loop.
dateArray[y] = "datePicker" + i;
//out of loop scope
for (i = 0; i < dateArray.length; i++)
{
$(dateArray[i]).glDatePicker();
}
It does not seem to work , I have checked that there are values in the array by printing the values to the log.
Is this a limitation of jQuery?
Thanks
datepicker1the tag name ?