Topic: reinitialize input labels
Hi
How do I reinitialize input labels after adding text dynamically to an input box, the name field only re-rendered after I clicked on it, materializecss that I used before buying md bootstrap has a fix for this.
http://materializecss.com/forms.html
After filling in text dynamically all I had to do was to run Materialize.updateTextFields(); method to reinitialize all the Materialize labels on the page
img link https://ibb.co/kYkWAx
I’m using AngualrJS and Jquery
Add comment
Jakub Strebeyko staff answered 7 years ago
Hi there overlaydev,
Thanks for contributing to the support board! The feature you mentioned seems like a valuable solution for dynamically added content, has been forwarded to the Team for consideration. As of time being, the most appropriate solution seems to be creating a custom function fire every time the content should be added that would be iterating over all labels (
.each()
), determining whether the input they apply to (the for="..."
) attribute) has some content within (.val()
) and, if so, adding appropriate class to that label (.addClass('active')
).
With Best Regards,
Kuba FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Answered
Specification of the issue
- User: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: Yes