var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|]/;

   
function check(e) {
   
var keynum
   
var keychar
   
var numcheck
   
// For Internet Explorer
   
if (window.event)
   
{
    keynum
= e.keyCode
   
}
   
// For Netscape/Firefox/Opera
   
else if (e.which)
   
{
    keynum
= e.which
   
}
    keychar
= String.fromCharCode(keynum)
   
if ((keychar.toString()).search(mikExp) == 0)
   
{

   
return false;
   
}
   
else {
   
return true;
   
}
   
}

   
<input type="text" name="display1" id="display1" value=""
    class="width241 input fnt11" onKeypress="javascript:return check(event);"  maxlength="20">