The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Adding elements with DOM

I have datatable form with a layout similar to a spreadsheet. Initially only a single row is displayed, but if a user wants to add another record, they can click a button to add a new row. This button fires some JavaScript that clones the current row node, resets all values to "" and appends the new row to the end of the table. With two of the fields, I have used a class of "date-picker" on an input field to attach a jQuery datepicker function. The problem is that when I clone the row node, the new now doesn't seem to trigger the jQuery date picker. I would have thought that if the node was cloned, then any behaviours attached to it would be cloned also. Does anyone have any suggestions as to why this isn't working?

Thanks for the help guys. So perhaps ocne I have called the function add a new row, I should call a function to walk the DOM for the table and add appropriate event handlers to inputs of class="date-picker"?

@baliramvyas: thank you for promoting your collection of ebooks. I have several reference books and Google at my finger tips but neither have been helpful thus far.