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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is several issues with your injected markup. All of you
idattributes 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
ivalue as an additional value to theidattribute.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
idattributes 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 waylive()bubbles events and more.Since jQuery 1.7
live()has been deprecated andon()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.