How to initialize file input dynamically with MDB 5?


Topic: How to initialize file input dynamically with MDB 5?

Marvin Herbold pro priority asked 1 months ago

How do you dynamically initialize a file input with MDB 5? There is zero JS documentation on the MDB 5 page for file inputs.


Grzegorz Bujański staff answered 1 months ago

Can you say something more? File input does not need to be initialized when added dynamically. Look here: https://mdbootstrap.com/snippets/standard/grzegorz-bujanski/2887341#js-tab-view


Marvin Herbold pro priority answered 1 months ago

Doh! I was missing the form-control class.

What threw me off was the message on the file input document page for MDB5 that says "The file input is the most gnarly of the bunch and requires additional JavaScript if you’d like to hook them up with functional Choose file… and selected file name text."

Since mine wasn't rendering correctly (due to the missing form-control class) I automatically assumed it was due to not having the "requires additional JavaScript" run on the control.


Please insert min. 20 characters.
Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB 5
  • MDB Version: 3.2.0
  • Device: All
  • Browser: All
  • OS: All
  • Provided sample code: No
  • Provided link: No
Tags