Skip to content
Advertisement

Password validation in a modal javascript

I am trying to check if two passwords (password1 and password2) in the input fields are the same. If I click the button there is automatically a text which is not in the corresponding condition of the button. I am trying to fix to display a text when – 1) Checking of empty password field. 2) minimum password length validation. 3) maximum length of password validation. https://jsfiddle.net/chrismontage/onh51g93/4/

JavaScript
JavaScript
JavaScript

Advertisement

Answer

you have to fetch the password input value in the button click listener function.

JavaScript
Advertisement