JQuery UI's datepicker and HTML Arrays?

Mark

New member
I have PHP creating a dynamic list of fields, which I would like to use JQuery UI's datepicker on. All of the fields are in an array so I can manage them easy...so how can I make it make all of the fields use the datepicker? I've tried the following with no luck:

// Datepicker
$('#datepicker[]').datepicker({
inline: true,
showButtonPanel: true,
changeMonth: true,
changeYear: true
});
 
This answer is a guess:
// Datepicker
$('#datepicker[*]').datepicker({ // Added asterick (*) for wild card?
inline: true,
showButtonPanel: true,
changeMonth: true,
changeYear: true
});

Anyways, If i understand you correctly, why do you not use a for loop?:
for(var i = 0, i < count(datepicker), i++){
$('#datepicker').datepicker({
inline: true,
showButtonPanel: true,
changeMonth: true,
changeYear: true
});
}
instead of count, research what the JavaScript syntax for finding an array's length is. I used C++'s method, not sure if they are the same or not.
Good Luck!
 
Back
Top