Originally posted by Tarun Yadav:
This is JavaScript query, not JSP. Google "javascript restrict input" and you'll get lots of discussions, scripts and other related resources to help you with this.
Here's a quick link: http://www.rgagnon.com/jsdetails/js-0084.html, it works for alphanumeric input but you can easily modify the regex to only leave out the numbers also.
If it is important that only alpha characters get through, then this should also be validated on the server.
Starting with version 1.4,
Java ships with a very robust regular expression package. Start by looking at the
String.matches method.