Forums

Give help. Get help.

  • # May 20, 2013 at 7:50 pm

    Pretty sure I’m not doing this correctly:

    if (isNaN( $(“#field”).val() ) && val.length >= min && val.length < = max) {
    showMessage(‘Your password is good!’);
    }

    http://jsfiddle.net/wGVMW/

    # May 20, 2013 at 8:08 pm

    it works?

    But i would not use javascript to do this because its easy for the user to alter.

    # May 20, 2013 at 8:22 pm

    Still isn’t working correctly. :/ I want it to say “Your password is good!” ONLY when there is at least one number in the password, and the password itself needs to be >= 8 chars, and <= 32 chars. I'm sorry if I didn't seem clear. Thanks for the help Mottie!

    # May 20, 2013 at 8:50 pm

    Thanks for the help man! It works great.

    # May 21, 2013 at 7:35 am

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

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag