Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
173
rated 0 times [  179] [ 6]  / answers: 1 / hits: 18721  / 12 Years ago, thu, october 11, 2012, 12:00:00

I want to allow only English,numeric and special characters to be typed in my web page. i want to apply this thing using jquery or javascript. Actually my application is in 2 languages so for that i want to do this. I want to do the same thing with Arabic language too.. please help me.
How can I do that?


More From » jquery

 Answers
12

if ch is that char,you can do this



if((ch.charCodeAt(0)>=a.charCodeAt(0) && ch.charCodeAt(0)<=z.charCodeAt(0))||(ch.charCodeAt(0)>=A.charCodeAt(0) && ch.charCodeAt(0)<=Z.charCodeAt(0)))


You can do the same comparison with arabic character



which is represented in unicode



[u0600-u06ff]|[u0750-u077f]|[ufb50-ufc3f]|[ufe70-ufefc]

[#82607] Wednesday, October 10, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
elainaw

Total Points: 83
Total Questions: 99
Total Answers: 111

Location: South Sudan
Member since Sat, May 27, 2023
1 Year ago
elainaw questions
;