Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanjeev Papnoi committed Mar 5, 2021
1 parent 97543ad commit 17600b2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions public/scripts/wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
let errorFlag = false;
let nameRegex = /^[A-Za-z][A-Za-z]*[\sA-Za-z]*$/;
let emailRegex = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
let passwordRegix = /^(?=(.*[a-zA-Z].*){2,})(?=.*\d.*)(?=.*\W.*)[a-zA-Z0-9\S]{8,}$/;
let passwordRegix = /^(?=(.*[a-zA-Z].*){2,})(?=.*\d.*)(?=.*\W.*)[a-zA-Z0-9\S]{8}$/;

let user = {
name: this.$el.find('input[name="name"]').val(),
Expand Down Expand Up @@ -303,11 +303,9 @@
}
}

if (user.password.length > 0 && user.password.length < 8) {
if(passwordRegix.test(user.password)) {
if (user.password.length > 0 && (!passwordRegix.test(user.password))) {
errorFlag = true;
this.$el.find('input[name="password"]').parent().append("<span class='wizard-form-notice'>Passwords must contain 8 character length, at least two letters (not case sensitive), one number, one special character(space is not allowed.)</span>")
}
}

if (user.confirmPassword.length > 0 && user.confirmPassword != user.password) {
Expand Down

0 comments on commit 17600b2

Please sign in to comment.