Registration Form Password Validation

Topic: Registration Form Password Validation

Byron Cross free asked 3 years ago

I used the registration and login modal on the site and I'vemagaed to get everything else validated but the password and retype password validation isn't going so well. I have attached the code of what I thought was correct. If anyone can please let me know where I'm going wrong that would be amazing. Thank you.

if(registerPassword == registerRetypePassword){
      document.getElementById('registerStatus').innerHTML = "Passwords Match";
      return true;
      document.getElementById('registerStatus').innerHTML = "Passwords do not match";
      return false;

I have declared the variables above this script. Thank you.

Magdalena Dembna staff commented 3 years ago

Basic logic seems to be ok. Can you please provide entire code snippet here: ? It would be much easier to find a problem.

Byron Cross free commented 3 years ago

Here is the snippet: thank you.

Magdalena Dembna staff answered 3 years ago

If you could open the following link and look at the material styles example:

Firstly, invalid feedback message is a div element below the input with invalid-feedback class. In JavaScript tab you can look at a validation - unsuccessful passwords matching should call event.preventDefault() for submit - if not, form will be still send and modal closed.

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
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.8.0
  • Device: Mac
  • Browser: Chrome
  • OS: Ojave
  • Provided sample code: No
  • Provided link: No