If you want to allow only characters and digits, you need not know keycodes of all the special characters. Just compare the characters' and digits' ASCII values with the character entered on OnKeyUp event. If it's a special character, just drop it.
You can also use java.util.regex.Pattern and java.util.regex.Matcher classes at server side. -----Original Message----- From: Medicherla Lakshmi [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 2:29 PM To: Struts Users Mailing List Subject: Javascript problem, how to control special characters from being entered into textbox Hi, I hava a javascript problem. I need to restrict anyone entering special characters into a textbox which is there in my html. I know that i can use onKeyPress event to handle this, but for this i need to know the keycodes. Please anyone tel me if there is any other way to handle this or tel me how to know the keycodes of the characters, so that i can use it. Also, i have to restrict the textboxes with characters and then digits. Thanks in advance. --------------------------------- Yahoo! India Answers: Share what you know. Learn something new Click here Catch all the FIFA World Cup 2006 action on Yahoo! India Click here --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]