This is a migrated thread and some comments may be shown as answers.

Displaying error message on typing a invalid character

1 Answer 224 Views
Input
This is a migrated thread and some comments may be shown as answers.
saravanan k
Top achievements
Rank 1
saravanan k asked on 24 Jun 2010, 08:47 AM
Hi,

      I have a requirement like, I should accept any string which does not contain some special characters like @,*,& etc. Actually i should block the user from typing these character.
Similar behavior as the unit price text box in this example
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx.

At the same time i should display some error message to the user about the blocking action. I am bit confused of acheiving this through radinputmanager and a asp text area control.

I tried setting the telerik:RegExpTextBoxSetting tag with the right regular expression, validation message and the control id, but the validation happens only on click of any button.
This is the link i used as reference http://www.telerik.com/help/aspnet-ajax/using_radinputmanager.html

Kindly help me with some code snippets.

Regards,
Saravanan K

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Jun 2010, 01:27 PM
Hello Saravanan,


One suggestion would be attaching the TextBoxSetting-ClientEvents-OnKeyPress event and check for the key pressed. You can also alert if the user typed invalid key.

Check out the documentation to know more about the event:
OnKeyPress


Feel free to share the comments,
Shinu.

Tags
Input
Asked by
saravanan k
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or