Topic: Form validation with js not working

demzl25 pro asked 1 year 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 1 year 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 pro commented 1 year ago

Thanks that is helpful!


demzl25 pro commented 1 year ago

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


Grzegorz Bujański staff commented 1 year 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

  • ForumUser: Pro
  • Premium support: No
  • 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