Trouble initializing datepicker in dynamically added table rows...
Hello folks,
The project I'm working on is immensely important in the medical world of claims and insurance. The onus is on me to deliver a top notch product with excellent scripting logic. I stumbled onto jQuery a few months back and it has literally saved us tons of work. Thank you, jQuery team.
Now to my problem. I'm using clone() to insert a new row dynamically in a table. Ex
- $("#table tbody tr:last").clone(true).insertAfter("#table tbody tr:last");
One of the columns has a datepicker, specifically the one shown in the link below.
http://milesich.com/timepicker/ The manner in which I'm initializing the date is as follows:
- $("input[name=datefield]").datepicker({arguments})
Datepicker works flawlessly when an array of fields sharing the same name attribute are pre-loaded.
However, datepicker is not triggering in dynamically added rows. I've tried assigning separate id's for each row but it's cumbersome and unmanageable.If someone can kindly tell me what's wrong, I'd be grateful.
Regards,
Ramappa