Topic: reinitialize input labels

Troy pro asked 6 years ago


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

Jakub Strebeyko staff answered 6 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

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: Yes
Tags