-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Script not working on dynamically inserted elements #54
Comments
Thanks for reporting this. Can you update the issue with a simple example? That would make it easier for me to debug. I have never noticed any problems with dynamically created elements, but I only actually test ones created with native DOM methods rather than any libraries. |
After a bit of fiddling with the script I managed to get it to insert the placeholder text when the element is created, however this leaves the possibility of the placeholder text being submitted to the database. In the end I decided to write my own( more angular-friendly) implementation which doesn't interfere with the data bindings. I can post my code if you want. (it involves a dummy element that holds the placeholder and passes the focus to the real one) |
Hello crisbeto, I'd be interested in seeing your solution if you wouldn't mind as I ran into the same problem. Thanks, |
Hope it helps: https://gist.github.com/crisbeto/7698305 |
Elements that are inserted through JavaScript don't get the placeholder functionality.
It works when elements are added with jQuery, however it doesn't work on elements added through AngularJS.
Also tried triggering it manually with Placeholders.enable(element); but it doesn't work.
The text was updated successfully, but these errors were encountered: