Form controls not working in Modal


Topic: Form controls not working in Modal

itsupport.engineer pro premium priority asked 3 years ago

Hi Friends,

Form controls not working in modal, When you want to do form submit using modal.

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

    document.querySelectorAll('.datepicker').forEach((formDatepicker) => {
      new mdb.Datepicker(formDatepicker).init();  
    });

mdb.Input is working but datepicker not works for me.

If someone can give me better idea then it is very helpful for our future work.

Thank You!


itsupport.engineer pro premium priority answered 3 years ago

Hi @kpienkowska

Thank you for replying me. It was very helpful your snippet.

I have finally found the solution in my code. Basically we have to add modal html code before add script mdb.min.js in the page. so that it initialise to modal elements.

That was the solution in my case. no need to manually initialise etc.

Thank you very much for help me.


kpienkowska staff answered 3 years ago

I checked and everything works for me without the need to initialize via JS: https://mdbootstrap.com/snippets/standard/kpienkowska/3956366

Create a snippet in which the error you are talking about will appear, we will check what is happening.


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 4.0.0
  • Device: Desktop
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No