Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67469

Angular one of the conditions is to check the password field for certain characters only [! @ $% & *]

$
0
0
checkParams(event) {

    if (event.length > 8 && event.length <= 30) {
        this.passLength = true;
    } else {
        this.passLength = false;
    }
//quantity check

    if (event.search(/[0-9]/) > -1) {
        this.passNumbers = true;
    } else {
        this.passNumbers = false;
    }
//number check

    if (event.search(/[!@$%&*]+/) > -1) {
        this.passSpecial = true;
    } else {
        this.passSpecial = false;
    }
//character check

    if (event.search(/[a-z].*[A-Z]|[A-Z].*[a-z]/) > -1) {
        this.passUpper = true;
    } else {
        this.passUpper = false;
    }
//check upper case 

    if (event.search(/^\S*$/)) {
        this.passSpace = false;
    } else {
        this.passSpace = true;
    }
//check whitespace

Viewing all articles
Browse latest Browse all 67469

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>