js/scripts.js
//Variable to count the numebr of attempts.
Variable to count the numebr of attempts.
Variable to count the numebr of attempts .
function validate(){
        var username = document.getElementById("adminusername").value;
        var password = document.getElementById("adminpassword").value;
        if (username == "cybillAdmin" && password == "cybill3241") {
            alert ("Login successfully");
            window.location = "index2.html";
            return false;
        }
        else{
            attempt --; 
            alert("You have left "+attempt+" attempt;");
            if( attempt == 0){
                document.getElementById("adminusername").disabled = true;
                document.getElementById("adminpassword").disabled = true;
                document.getElementById("submit").disabled = true;
                return false;
            }
        }
    }
function validate ( ) { var username = document . getElementById ( "adminusername" ) . value ; var password = document . getElementById ( "adminpassword" ) . value ; if ( username == "cybillAdmin" && password == "cybill3241" ) { alert ( "Login successfully" ) ; window . location = "index2.html" ; return false ; } else { attempt -- ; alert ( "You have left " + attempt + " attempt;" ) ; if ( attempt == 0 ) { document . getElementById ( "adminusername" ) . disabled = true ; document . getElementById ( "adminpassword" ) . disabled = true ; document . getElementById ( "submit" ) . disabled = true ; return false ; } } }
Variable to count the numebr of attempts.
Variable to count the numebr of attempts .
//Decrementing by one.  //Disabling fields after 3 attempts.