i want to write a javascript code to avoid special characters in the textbox but,
it should allow comma , round brackets and forward slash
below is the javascript code which i have used it avoid all the special characters
- <script type="text/javascript">
- function blockSpecialChar(e){
- var k;
- document.all ? k = e.keyCode : k = e.which;
- return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8 || k == 32 || (k >= 48 && k <= 57));
- }
- </script>