but tell me how to write the validatorexpression that text box has to allow the alpha numeric characters ,spaces and specila symbols that are ,/?*& and etc
I tested with the expression you used ([0-9a-zA-Z;/?'*@-]) and it works fine but only for single length (i.e., 5 or S or @ or - but not for 55 or SSS). You can simple use [0-9a-zA-Z;/?'*@-]* and the text box will act like a normal text but accept only 0-9,
a-z chars and ; ? ' * @ -
RegularExpressionValidator control is the best way for this purpose. You can also use Regex class to validate the text box value.
Please mark it as the answer if it helps you
http://lovecsharp.blogspot.com/
but I have another dought can we write any regular expression that text box has to allow first character only not numbers,dot and underscore and the first letter should be capital letter only
i am not able to understand one thing.. when you are allowing all the characters numbers, and alphabets.. then for what purpose you want to put regular expression........................
"Mark as answered if you feel this helps you"
"There are NO shortcuts for success, better stop taking one."
I want to allow all the characters , numbers and special characters in the textbox
but I am asking you the people seniors is it any regular expression the first letter should be capital letter and not number in the textbox
i.e when I entered the small letter or number in the textbox first time its has to show any error message i.e the firsr letter should be Capital letter that the text has to allow
i.eGeeta123 is correct(here its capital letter) but geeta123 is wrong(g is small)
124Geeta is also wrong(starts with number)
I want to allow all the characters , numbers and special characters in the textbox
but I am asking is it any regular expression the first letter should be capital letter and not number in the textbox
i.e when I entered the small letter or number in the textbox first time its has to show any error message
i.e the firsr letter should be Capital letter that the text has to allow i.eGeeta123 is correct(here its capital letter) but geeta123 is wrong(g is small) 124Geeta is also wrong(starts with number)
any ways to do the programming like this ................................
geeta_ravika...
Member
22 Points
91 Posts
Re: text box has to allow special characters
Jun 23, 2008 01:13 PM|LINK
I saw all the links
but tell me how to write the validatorexpression that text box has to allow the alpha numeric characters ,spaces and specila symbols that are ,/?*& and etc
mac10
Participant
964 Points
163 Posts
Re: text box has to allow special characters
Jun 23, 2008 01:32 PM|LINK
Hi Geeta,
I tested with the expression you used ([0-9a-zA-Z;/?'*@-]) and it works fine but only for single length (i.e., 5 or S or @ or - but not for 55 or SSS). You can simple use [0-9a-zA-Z;/?'*@-]* and the text box will act like a normal text but accept only 0-9, a-z chars and ; ? ' * @ -
RegularExpressionValidator control is the best way for this purpose. You can also use Regex class to validate the text box value.
http://lovecsharp.blogspot.com/
Chetan Chopa...
Participant
1980 Points
347 Posts
Re: text box has to allow special characters
Jun 24, 2008 04:06 AM|LINK
Try this ^[0-9a-zA-Z;/?'*@-]*
geeta_ravika...
Member
22 Points
91 Posts
Re: text box has to allow special characters
Jun 24, 2008 05:02 AM|LINK
thanq very much chetan
its working well
but I have another dought can we write any regular expression that text box has to allow first character only not numbers,dot and underscore and the first letter should be capital letter only
i.e eg.Geeta123 ,but not 123Geeta
or I have to write the backend coding
any solutions or suggestion for this
---------------------------
regards
Geeta
blurearc
Contributor
3710 Points
692 Posts
Re: text box has to allow special characters
Jun 24, 2008 05:11 AM|LINK
i am not able to understand one thing.. when you are allowing all the characters numbers, and alphabets.. then for what purpose you want to put regular expression........................
"There are NO shortcuts for success, better stop taking one."
Ravi Kant Srivastava
SanjaySutar
Participant
1128 Points
692 Posts
Re: text box has to allow special characters
Jun 24, 2008 05:20 AM|LINK
Hi,
what i understand from your question is that
u want everything to be allowed in your textbox
then why do u want a validator ??
Textbox can accept all values be defualt.
If u don't want a particular character then specify that only in validation expression.
Moreover u can try this site
www.regular-expressions.info
Hope that helps
geeta_ravika...
Member
22 Points
91 Posts
Re: text box has to allow special characters
Jun 24, 2008 10:09 AM|LINK
thanQ for the reply,
I want to allow all the characters , numbers and special characters in the textbox
but I am asking you the people seniors is it any regular expression the first letter should be capital letter and not number in the textbox
i.e when I entered the small letter or number in the textbox first time its has to show any error message i.e the firsr letter should be Capital letter that the text has to allow
i.eGeeta123 is correct(here its capital letter) but geeta123 is wrong(g is small) 124Geeta is also wrong(starts with number)
any way to do the programming like this
................................
if any body have ideas please let me know.
regards
Geeta
SanjaySutar
Participant
1128 Points
692 Posts
Re: text box has to allow special characters
Jun 24, 2008 10:12 AM|LINK
i don't c any reason to use Validator since u want to allow everything that textbox by default allows.
geeta_ravika...
Member
22 Points
91 Posts
Re: text box has to allow special characters
Jun 24, 2008 10:12 AM|LINK
thanQ for the reply,
I want to allow all the characters , numbers and special characters in the textbox
but I am asking is it any regular expression the first letter should be capital letter and not number in the textbox
i.e when I entered the small letter or number in the textbox first time its has to show any error message
i.e the firsr letter should be Capital letter that the text has to allow i.eGeeta123 is correct(here its capital letter) but geeta123 is wrong(g is small) 124Geeta is also wrong(starts with number)
any ways to do the programming like this ................................
if any body have ideas please let me know.
regards
Geeta
geeta_ravika...
Member
22 Points
91 Posts
Re: text box has to allow special characters
Jun 24, 2008 10:17 AM|LINK
the text box is allowing every thing but I want to check the first letter should be Capital letter or small letter or number ,dot or undersocre
If its small letter or number or dot or undersocre or any specila characters it has to display the error message
please tell me did you understan my Q?