Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Form Validation

tnhnet priority asked 2 years ago


Expected behavior disable a submit button until all form fields are valid or how to know that form is valid and we are good to go or not.

Actual behavior the validation is visual only by adding was-validated class and there is no way to confirm validated fields. 2nd, the MDBSelect doesn't react to visual validation

Resources (screenshots, code snippets etc.)


Mateusz Trochonowicz staff answered 2 years ago


Hi! In this particular case there is simple validation which checks if all inputs are not empty. A little bit explanation about how our validation works is in section How it works. But if you want more complex solutions, you can check our Input mask plugin, which provide more sophisticated validation on client side. In any other case you got to write - for example - regular expression which will be checking inputs values in function added to submit function.

But if you want disable button before complete all inputs, you can simply add computed variable and pass it to disabled properties in MDBBtn - check out my snippet.

Our validation do not support MDBSelect component - as you can check in Supported elements page.

Keep coding!



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: Priority
  • Premium support: Yes
  • Technology: MDB Vue
  • MDB Version: MDB5 3.0.0
  • Device: Any
  • Browser: Any
  • OS: Any
  • Provided sample code: No
  • Provided link: No