Topic: Form validation with js not working

demzl25 priority 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:



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 priority commented 1 year ago

Thanks that is helpful!

demzl25 priority commented 1 year ago

Is this what you have in mind?

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.


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



Specification of the issue

  • ForumUser: Priority
  • 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