I have some input text fields that are being generated on the fly (via javascript) by the user. I want those fields to accept integers only so I am using the alphanumeric plugin. The plugin works as expected on elements that already exist when the page loads but it does not work with the new on-the-fly elements. How can I live-bind the new elements to this plugin? Thanks!
Here is some sample code.
Simple quick fix – change:
to
Please notice that the dynamically inserted fields are all getting the same id. That’s not good, you should either use a unique id for each input, or no id at all.