Click here to Skip to main content
15,885,707 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i want to validate a text which will not allow special characters and allow alphanumeric keys, space, backspace, delete,right and left arrow, tab.
Posted
Comments
jgakenhe 3-May-15 0:28am    
You need to use Regular Expressions.

http://stackoverflow.com/questions/839483/special-character-validation-using-javascript

You can either use Regex or handle the onkeypress event and write you logic to restrict the specific characters.

See How to restrict special characters being entered in textbox using javascript?[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900