Try this:
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("input").keypress(function(event){
//KeyCode 65-90 is A-Z
//KeyCode 97-122 is a-z
if((event.which >= 65 && event.which <= 90) ||
(event.which >= 97 && event.which <= 122) ||
(event.which == 45) || // -
(event.which == 47) || // /
(event.which == 95)) // _
{
return true;
}else{
return false;
}
});
});
</script>
</script>
</head>
<body>
<input type='text' />
</body>
</html>