0

I have a form where a button allows me to add as many rows as I need in a table. Inside this table and its <td>, I have a td for the datepicker of the jquery-ui.

In this jsfiddle, i am not able to open the datepicker for the first row and neither for the rows created after.

In my local website instead, the first row have the datepicker working, the rows created after instead have not. It is probably a problem in calling the proper function but I can not see it now.

Shortly, both of them have this issue where I can add a new row but even tho the id is increased correctly, the datepicker won't open.

Link to the jsfiddle: my jsfiddle

aPugLife
  • 989
  • 2
  • 14
  • 25

2 Answers2

0

You create dynamically new elements. Have a look at: Event binding on dynamically created elements?

how to bind events to these elements.

Community
  • 1
  • 1
Leszek P
  • 1,807
  • 17
  • 24
  • interesting but i probably need to rework the whole code, because the example posted is just a tiny part of it. This project is used by really few persons, I'd just wish to fix it, not really going to improve the mechanism behind. But thanks for pointing it up! – aPugLife Feb 08 '17 at 13:53
0

Alright I solved. I call the function in the wrong row. Must not call after I increment j rather before.. silly me :D

aPugLife
  • 989
  • 2
  • 14
  • 25