I can't figure out what I'm doing wrong. I have dynamically generated input fields with class='freeze-date' that only works on the 1st datepicker input-field generated. I have the code @ http://jsfiddle.net/Someguy2k/L9nvs/3/
Thanks
I can't figure out what I'm doing wrong. I have dynamically generated input fields with class='freeze-date' that only works on the 1st datepicker input-field generated. I have the code @ http://jsfiddle.net/Someguy2k/L9nvs/3/
Thanks
There is several issues with your injected markup. All of you id attributes in each row of elements have the same value.
Not only is that invalid HTML but also results in side-effects such as this one.
jQuery will look for an id and stop when it finds the first match.
I fixed that particular issue with your calendar by adding the i value as an additional value to the id attribute.
... id='freezeby" + i + "' ...
See DEMO
If you find other elements are behaving the same when interacted with it is most likely due to the same reasons as I have seen the other id attributes also having the same issue.
Using Live()
In addition, you are using live(). Live has several issues and all the drawbacks are listed in the documentation. Memeory leaks, unexpected loss of events bindings, stopPropagation() doesn't work due to the way live() bubbles events and more.
Since jQuery 1.7 live() has been deprecated and on() is preferred. For your version it is preferred to use bind() for binding events to static elements and delegate() to bind events to dynamic elements.
i value as that is what you used in other places already. Regarding jQuery, the most important thing you will find is their online documentation. It is very clear and is always updated with latest news on deprecated functionality and so on. I linked all of the relevant documentation in the answer. Have fun :)