Monday, 7 November 2016

ALLOW only Alphabates text Box Validation

Only alphabates ALLow:

 function Alphabets(nkey) {
        var keyval
        if (navigator.appName == "Microsoft Internet Explorer") {
            keyval = window.event.keyCode;
        }
        //For A-Z
        if (keyval >= 65 && keyval <= 90) {
            return true;
        }
        //For a-z
        else if (keyval >= 97 && keyval <= 122) {
            return true;
        }
        else if (keyval == 32) {
            return true;
        }
        else {
            return false;
        }
    }

No comments:

Post a Comment