﻿// JScript File

//Login Checking 
function Validatelogin()
{
    if(document.getElementById('txt_userid').value =="")
    {
     alert("Enter the User - Id");
     document.getElementById('txt_userid').focus();
     return false;
    }    
    if(!validateText(document.getElementById("txt_userid").value))
    {
        alert("Don't Enter Any Special Characters & Digits while entering User - Id");
        document.getElementById("txt_userid").focus();
        document.getElementById("txt_userid").select();
        return false;
    }
    if(document.getElementById('txt_password').value =="")
    {
     alert("Enter the Password");
     document.getElementById('txt_password').focus();
     return false;
    }    
    if(!validateText(document.getElementById("txt_password").value))
    {
        alert("Don't Enter Any Special Characters & Digits while entering Password");
        document.getElementById("txt_password").focus();
        document.getElementById("txt_password").select();
        return false;
    }    
}

function validateText(name)
{
    invalidChars = "*\\''`///\""
    for (i=0; i<invalidChars.length; i++)
    {
        badChar = invalidChars.charAt(i)
        if (name.indexOf(badChar,0) > -1)
        {
            return false
        }
    }
    return true
}