Datepicker and dynamic html - not finding id
Hi,
I am creating a table dynamically, and the table cell in question creates a text box as follows:
- var cell1 = row.insertCell(0);
- var el1 = document.createElement('input');
- el1.type = 'text';
- el1.name = 'date_from' + iteration;
- el1.id = 'datepicker';
- cell1.appendChild(el1);
The html is created fine, however the id is not being found for the datepicker function when creating the element dynamically. when i manually insert a text box and give it the datepicker id, it works great.
- $(function() {
- $("#datepicker").datepicker();
- $.datepicker.setDefaults($.datepicker.regional['']);
- });
Any help would be great here --
thanks!