Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

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!?

#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 ;)