I am trying to prevent users from typing certain characters in text boxes and this is the code that I have so far :
$().ready(function() {
$(\".textbox\").keyp
Your keyVal assignment didn't take all browsers into account. This piece of code works in Firefox, IE7, Safari, Chrome and won't let you type numbers in the field, tested with a normal text input element:
$().ready(function(){
$(".textbox").keypress(function(event){
var keyVal = (event.charCode ? event.charCode : ((event.keyCode) ? event.keyCode : event.which));
if((keyVal > 48 && keyVal < 57))// Numbers
{
return false;
}
});
});