So here is this element:
<TD><INPUT type="text" name="when"/></TD>
I can call a function by
$(document).ready(function() {
$('input[name=when]').datepicker();
});
This works fine. (When I click the element, a datepicker shows up).
But what if this is the element?
<TD><INPUT type="text" name="when[]"/></TD>
Then this does not work:
$(document).ready(function() {
$('input[name=when[]]').datepicker();
});
EDIT:
So thank you for answering me guys, I did not know this. However. I let the users add rows to the table dynamically so each added row should inherit this function. Unfortunately it does not work in the dynamically created rows:
function setClass() {
$('input[name="when[]"]').datepicker();
//or $('input[name=when\\[\\]]').datepicker();
}