Topic: Form validation with js not working

demzl25 premium asked 5 months ago


Expected behavior

Hi, I'm not able to set up form with first js and second server-side validation.

Actual behavior

Form validation is not working with js.

Resources (screenshots, code snippets etc.)

Here is example code snippet: https://mdbootstrap.com/snippets/standard/demzl25/3912833#html-tab-view

Thanks,

Damjan


Grzegorz Bujański staff answered 5 months ago


First, replace the code responsible for validation with the code that adds event listeners - the code responsible for validation must be at the top.

Additionally, validation will not work correctly if valid and invalid feedback is not an input sibling.


demzl25 premium commented 5 months ago

Thanks that is helpful!


demzl25 premium commented 5 months ago

Is this what you have in mind? https://mdbootstrap.com/snippets/standard/demzl25/3912833#html-tab-view


Grzegorz Bujański staff commented 5 months ago

Yes. From what I can see, the validation is now working properly



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

  • User: Premium
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 4.2.0
  • Device: Pc
  • Browser: Chrome 97.0.4692.99
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: Yes