afb35d9e1f92c82a1f89ba2084abf4d350cd6446335053c6b9e946bc5fe43486

Source Code:

const docs = document;
function err() {
    event.preventDefault();
}
function mod(id,ide) {
    docs.querySelector(id).classList.remove('required');
    docs.querySelector(ide).classList.add('noerr');
}
function errr(a,b){
    docs.querySelector(a).classList.remove(b);
}
function erra(c,e){
    docs.querySelector(c).classList.add(e);
}

function auth(){
    var reg = /^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()\.,;\s@\"]+\.{0,1})+[^<>()\.,;:\s@\"]{2,})$/;
    let em = docs.getElementById('ape').value;
    if(em.match(reg)){
        let pw = docs.getElementById('app').value;
        if(pw !== ''){
            if(pw.length < 6){
                //Condition 2 mismatch.
                err();
                errr('#errBox','noerr');
                erra('#em','noerr');
                errr('#pw','noerr');
                erra('#fep','required');
            }
            else {
                erra('#errBox','noerr');
                errr('#fem','required');
                errr('#fep','required');
            }
            //Email and password verified.
        }
        else {
            //Condition 2 unfulfilled
            err();
            errr('#pw','noerr');
            erra('#fep','required');
            if(em.match(reg)){
                errr('#errBox','noerr');
                erra('#em','noerr');
                errr('#fem','required');
            }
        }
    }
    else {
        err();
        errr('#errBox','noerr');
        errr('#em','noerr');
        erra('#fem','required');
        let pw = docs.getElementById('app').value;
        if (pw !== '') {
            if (pw.length < 6) {
                errr('#pw','noerr');
                erra('#fep','required');
            }
            else {
                erra('#pw','noerr');
                errr('#fep','required');
            }
        }
        else {
            errr('#pw','noerr');
            erra('#fep','required');
        }
        //Condition 1 failed.
    }
}
function vcd(value) {
    // Accept only digits, dashes or spaces
    if (/[^0-9-\s]+/.test(value)) return false;

    // The Luhn Algorithm. It's so pretty.
    let nCheck = 0, bEven = false;
    value = value.replace(/\D/g, "");

    for (var n = value.length - 1; n >= 0; n--) {
        var cDigit = value.charAt(n),
            nDigit = parseInt(cDigit, 10);

        if (bEven && (nDigit *= 2) > 9) nDigit -= 9;

        nCheck += nDigit;
        bEven = !bEven;
    }

    return (nCheck % 10) == 0;
}


function last(){
    let cnhd = docs.getElementById('ccol1').value;
    let chcc = docs.getElementById('ccol2').value;
    var isV = vcd(chcc);
    if((cnhd === '') && (chcc === '')) {
        err();
        erra('#wccol1', 'required');
        errr('#err-c-c','noerr');
        errr('#err-c-1','noerr');
        errr('#err-c-2','noerr');
    }
    if(cnhd === '') {
        err();
        erra('#wccol1', 'required');
        errr('#err-c-c','noerr');
        errr('#err-c-1','noerr');
    }
    else {
        errr('#wccol1', 'required');
        erra('#err-c-c','noerr');
        erra('#err-c-1','noerr');
    }
    if(chcc === ''){
        err();
        erra('#wccol2','required');
        errr('#err-c-c','noerr');
        errr('#err-c-1','noerr');
    }
    else {
        if(isV === true){
            errr('#wccol2', 'required');
            erra('#err-c-c','noerr');
            erra('#err-c-1','noerr');
            erra('#err-c-3','noerr');
        }
        else {
            err();
            erra('#wccol2','required');
            errr('#err-c-c','noerr');
            erra('#err-c-1','noerr');
            errr('#err-c-3','noerr');
        }

    }
    let cssc = docs.getElementById('ccol5').value;
    if(cssc === ''){
        err();
        erra('#wccol3','required');
        errr('#err-last-c','noerr');
        errr('#err-last-1','noerr');
    }
    else {
        errr('#wccol3','required');
        erra('#err-last-c','noerr');
        erra('#err-last-1','noerr');
    }
}