Click here to Skip to main content
16,021,288 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
when Validating Special Character,the msg box comming(alert)but in msg box click the OK button the character is display on text box why?
Posted
Updated 5-Jan-12 4:08am
v2
Comments
OriginalGriff 5-Jan-12 10:41am    
No, sorry, I've read that several times, and I still can't work out what your problem is.
Please, try to explain in more detail what you are trying to do, and how it isn't working.
Try including some relevant code fragment if your English is not up to a good description.
Use the "Improve question" widget to edit your question and provide better information.
Kethu Sasikanth 5-Jan-12 22:15pm    
check the validation javascript function() return value if it is populating the textbox.

1 solution

Please clarify this question:

Are you working in WinForms ? WPF ? ASP.NET ? ... or ?

What type of container is text being typed into ?

When are you raising the validation Event code ?

What "special characters" are you looking for, and what do you want to do when they are entered: ignore them: have them not appear in the container being typed into ? Take some special action ?

What is the reason for your presenting a MessageBox or Dialog: what are the choices on it, and what is supposed to happen for each of those choices ?

If you are working in WinForms different strategies need be used to handle different types of keys: at times you can set the "Handled" Property of the "e" parameter of the 'KeyPress EventHandler to "block" a certain key. At other times it may be necessary to set the 'SuppressKey Property.

Handling the "Add" on the numeric keypad requires a different code strategy than handling the case of holding-down the shift-key with the "+" symbol on the regular keyboard upper right row.

Tell us what you want ... in detail.

And look at the MS Docs for the KeyPress, KeyDown, and KeyUp events.
 
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