Sitee.in

Get A responsive website for Free , mobile-first projects on the web.

Javascript to block Keys in html form.

By : sourabh

2017-01-20 22:00:07

Javascript to block Keys in html form.

Use this code in head section in script tag.


        function blockSpecialChar(e) {
            var k = e.keyCode;
            return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8  || k == 45 || (k >= 48 && k <= 57));
        }

Copy this code where you want to execute the function 
onkeypress="return blockSpecialChar(event)"

--

Comment*
Website
Name*
Email*

*Required Field.

© 2015 blog.sitee.in