Home › Forums › JavaScript › Check if input value is >= 8 & <=32 & has at least 1 number!? › Re: Check if input value is >= 8 & <=32 & has at least 1 number!?
May 21, 2013 at 7:35 am
#135823
CrocoDillon
Participant
} else if (val.length == nul) {
showMessage(‘Enter in a password!’);
will never get reached (nothing filled in shows ‘Password is too short!’)
} else if (/d/.test(val) && val.length >= min && val.length <= max) { don’t need the if, just `} else {`, because you already know everything else evaluates to true at that point ;)