Force to upper case characters - DOTNET
This is a discussion on Force to upper case characters - DOTNET ; 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....
-
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.
-
Re: Force to upper case characters
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
-
Re: 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.
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
-
Re: Force to upper case characters
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
-
Re: Force to upper case characters
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
-
Re: Force to upper case characters
Why I can't use something like this?
<edititemtemplate>
<asp:TextBox ID="TextBox_str_coast_ref" runat="server" Text='<%#Bind
("str_coast_ref").ToUpper()%>'
</asp:TextBox>
</edititemtemplate>
It gives syntax error !
"Jesse Houwing" wrote:
> 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
>
>
>
-
Re: Force to upper case characters
> 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
-
Re: Force to upper case characters
yes
"rkbnair" wrote:
> Why I can't use something like this?
>
> <edititemtemplate>
>
> <asp:TextBox ID="TextBox_str_coast_ref" runat="server" Text='<%#Bind
> ("str_coast_ref").ToUpper()%>'
> </asp:TextBox>
>
> </edititemtemplate>
>
> It gives syntax error !
>
> "Jesse Houwing" wrote:
>
> > 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
> >
> >
> >
Similar Threads
-
By Application Development in forum CSharp
Replies: 3
Last Post: 08-09-2007, 11:41 AM
-
By Application Development in forum Clipper
Replies: 1
Last Post: 06-12-2007, 02:11 PM
-
By Application Development in forum Perl
Replies: 3
Last Post: 04-20-2007, 08:47 AM
-
By Application Development in forum Adobe Indesign
Replies: 1
Last Post: 02-01-2007, 05:12 AM
-
By Application Development in forum pl1
Replies: 59
Last Post: 09-27-2005, 01:36 AM