Topic: Input value on MDB?

Emilio Cardaropoli free asked 1 year ago

When i create in a form an input and set "values = x" on php, the page apperars really strange.

//Event name
        echo '<div class="form-outline mb-4 col-sm-5">
                  <i class="fas fa-exclamation-circle trailing"></i>
                  <input type="text" id="fname" name="EventName" class="form-control form-icon-trailing" value = "'.$name.'" />
                  <label class="form-label" for="form ">Evento</label>

How it should appeasr:enter image description here

How it appears:enter image description here

Mateusz Lazaru staff answered 1 year ago


form-outline is initialized when the page loads for elements containing form-outline class. If you create new form-outline element after that, you need to initialize it manualy, by running init() function.

document.querySelectorAll('.form-outline').forEach((formOutline) => {
  new mdb.Input(formOutline).init();

Please insert min. 20 characters.


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



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 5.0.0
  • Device: Computer
  • Browser: Brave browser
  • OS: Windows 11
  • Provided sample code: No
  • Provided link: No