473,326 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Force to upper case characters

How can I force the users to enter characters in uppercase? I want to do this
in a TextBox control of an aspx page. Then I want the same to be moved to
inside a GridView control.

Thanks.

Aug 30 '07 #1
5 4482
Hello rkbnair,
How can I force the users to enter characters in uppercase? I want to
do this in a TextBox control of an aspx page. Then I want the same to
be moved to inside a GridView control.
Add a RegularExpressionValidator to the form and set it's expression to:

^[A-Z]+$

If for some reason the regex validator defaults to caseinsensitive (I've
never tried if it is before now that I think of it) you can use:

^(?-i:[A-Z])$

To force case sensitive mathing

--
Jesse Houwing
jesse.houwing at sogeti.nl
Aug 30 '07 #2
>How can I force the users to enter characters in uppercase? I want to
>do this in a TextBox control of an aspx page. Then I want the same to
be moved to inside a GridView control.
Depending on what is the content of that box, it might be very bad for
international users.

And in fact I would hate such a "feature" as US user.
It forces me to press caps-lock and type in ugly caps text that "screams"
And this is just to save some programmer the trouble of calling one single
API to convert a string to uppercase.

Add a RegularExpressionValidator to the form and set it's expression to:

^[A-Z]+$

If for some reason the regex validator defaults to caseinsensitive (I've
never tried if it is before now that I think of it) you can use:

^(?-i:[A-Z])$
Again, bad internationalization. What about accented characters?
Russian, Greek, etc.?
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Aug 31 '07 #3
Hello Mihai N.,
>>How can I force the users to enter characters in uppercase? I want
to do this in a TextBox control of an aspx page. Then I want the
same to be moved to inside a GridView control.
Depending on what is the content of that box, it might be very bad for
international users.

And in fact I would hate such a "feature" as US user.
It forces me to press caps-lock and type in ugly caps text that
"screams"
And this is just to save some programmer the trouble of calling one
single
API to convert a string to uppercase.
>Add a RegularExpressionValidator to the form and set it's expression
to:

^[A-Z]+$

If for some reason the regex validator defaults to caseinsensitive
(I've never tried if it is before now that I think of it) you can
use:

^(?-i:[A-Z])$
Again, bad internationalization. What about accented characters?
Russian, Greek, etc.?
But if you're talking about some whipment code or a similar thign that will
be printed on some box, it might be unwise to allow greek, chineese etc.
I totally agree that in most situations it would not be a good thing to limit
a user to a very short range of characters, but there are some options I
could think of where it does make sense.

I agree that it would be even better to allow both lower and upper case variants
and just call ToUpper when the user leaves the field.

--
Jesse Houwing
jesse.houwing at sogeti.nl
Aug 31 '07 #4
Hello Jesse,
Hello Mihai N.,
>>>How can I force the users to enter characters in uppercase? I want
to do this in a TextBox control of an aspx page. Then I want the
same to be moved to inside a GridView control.
Depending on what is the content of that box, it might be very bad
for international users.

And in fact I would hate such a "feature" as US user.
It forces me to press caps-lock and type in ugly caps text that
"screams"
And this is just to save some programmer the trouble of calling one
single
API to convert a string to uppercase.
>>Add a RegularExpressionValidator to the form and set it's expression
to:

^[A-Z]+$

If for some reason the regex validator defaults to caseinsensitive
(I've never tried if it is before now that I think of it) you can
use:

^(?-i:[A-Z])$
Again, bad internationalization. What about accented characters?
Russian, Greek, etc.?
But if you're talking about some whipment code or a similar thign that
whipment

What was I thinking ;). I meant a Shipment Code on a parcel.

will be printed on some box, it might be unwise to allow greek,
chineese etc. I totally agree that in most situations it would not be
a good thing to limit a user to a very short range of characters, but
there are some options I could think of where it does make sense.

I agree that it would be even better to allow both lower and upper
case variants and just call ToUpper when the user leaves the field.

--
Jesse Houwing
jesse.houwing at sogeti.nl
--
Jesse Houwing
jesse.houwing at sogeti.nl
Aug 31 '07 #5
But if you're talking about some whipment code or a similar thign that will
be printed on some box, it might be unwise to allow greek, chineese etc.
This is why my answer starts with: "Depending on what is the content of
that box, it might be very bad for international users."
Maybe my English was not clear enough, but that was the idea :-)
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Sep 1 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: programmerforhire | last post by:
Hello all, Is there a way to setup an ms-access table so that when I enter text in the 'datasheet' mode, it will automatically be converted tp upper case. Or must I use a Form for this? rex
8
by: MLH | last post by:
I have a textbox on a form into which an alpha-numeric string of data is entered. I wish to force the casual user, who would sometimes use upper case, sometimes not and sometimes MIX the case -...
17
by: Janice | last post by:
char* line = "abcd"; How to convert the line to upper case and print? Any option for printf to do this? Thanx
2
by: Richard MSL | last post by:
How do you make a ComboBox force casing to uppercase? With a TextBox, I do this: TextBox txtName; this.txtName.CharacterCasing = CharacterCasing.Upper; And it makes whatever the user types...
5
by: Nelson | last post by:
In my web form, I am converting all lower case letters to upper case when the user types the characters in the edit boxes. I am achieving that by injecting client side script (onkeyup event) for...
8
by: csanjith | last post by:
Hi, i have a situaion where i need to convert the characters entered in an text field to upper case using C. The configuration id utf8 environment in which user can enter any character (single ,...
5
by: bob | last post by:
Now this ought to be a simple matter. But nothing's simple in the Net world, I'm finding. In vb6 you could use "!" to force text to upper case in the format function. I've searched the vb.net...
3
by: bob | last post by:
In vb6 you could say s = Format(s, "!") to force text to upper case in the format function. I've searched the vb.net help system and can't find any help on formatting text. There's plenty of help...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.