Web Textbox CharacterCasing??

  • Thread starter Thread starter Tina
  • Start date Start date
T

Tina

The web textbox doesn't have a CharacterCasing property as does the forms
textbox. Any way cause characters typed in to be Upper case?
Thanks,
T
 
Tina said:
The web textbox doesn't have a CharacterCasing property as does the forms
textbox. Any way cause characters typed in to be Upper case?

I use CSS to do this.

<head runat="server">
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox ID="TextBox1" runat="server"
CssClass="UpperCase"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"
CssClass="ProperCase"></asp:TextBox>
</form>
</body>

Contents of StyleSheet.css

..UpperCase
{
text-transform:uppercase;
}

..ProperCase
{
text-transform:capitalize;
}

Greg
 
You need javascript to format the text as it is typed. Or convert to upper
case on the server.
 
Greg,
That worked great! Thanks
T

Greg Burns said:
I use CSS to do this.

<head runat="server">
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox ID="TextBox1" runat="server"
CssClass="UpperCase"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"
CssClass="ProperCase"></asp:TextBox>
</form>
</body>

Contents of StyleSheet.css

.UpperCase
{
text-transform:uppercase;
}

.ProperCase
{
text-transform:capitalize;
}

Greg
 
an interesting side effect....

if I have a regular expression tied to that field and the user enters lower
case, the RE gets the lower case but the textbox gets uppercase.

T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top