Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
2.71/5 (3 votes)
Hai Code project Team,


I have doubt in asp.net.My present web application Prompt the user in user enter the text other than English language in asp:textbox.


My Requirement is as follows
1.prompt the user in user enter the other than English language in the asp. text box.
Ex: asp:textbox user can enter only English letters like a-z A-Z other than this words like language like Germany, Spanish ,Telugu , Tamil ,Hindi etc.
If in case enter other than English word prompt the user PLEASE enter the english words only. If it is possible please help.

+ve test cases
1. abcdefghijklmnopqrstuvwxyz 0-9
2.ABCDEFGHIJKLMNOPQRSTUVWXYZ 0-9 symbols also

-Ve testcases


1. Gernmany words
2. Telugu words
3. TAMIL WORDS
4. other than english words

Is it possible in Script language like java script , j query.

Thanks
Sandeep Miriyala
Posted
Updated 26-Nov-13 20:46pm
v2
Comments
Maciej Los 27-Nov-13 1:53am    
Would you like to check lexical form of word(s)?
mn.sathish 27-Nov-13 1:57am    
Through regular expression you can check & show the alert. . ,
♥…ЯҠ…♥ 27-Nov-13 2:22am    
Regular expression will do the trick, I can write one for you if you want. Only alphabets, no numbers, no spaces, no spl characters, no apostrophe all information is needed... so update you requirement here

hi there

From my point of view you have to check each and every characters with asciicode or Unicode

Unicode is best solution.


thanks
abhishek
goletarabhishek8@live.com
 
Share this answer
 
Hi Miriyala,

Try this regular expression ^[\u0000-\u0080]+$

Tested input 1:
asdfdf adfkjadl34023 2342^*&(*)(_)_)(_) (*&@#@*#)KJHkjhkj2h3k4j23k4jl23kjl ljldfkjalkjfw098230940239 984379234283 - Ok
Tested input 2:
adfasdf தமிழ் மொழி afasdfd زبان_تامیلی adfads - Failed

You can test your own input in here[^].

Hope this helps you a bit.

Regards,
RK
 
Share this answer
 
v3

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