|
 |
aspx thread: TextBox all uppercase
Message #1 by "Mel C Solomon" <melsolomon@e...> on Thu, 14 Jun 2001 11:47:03 -0800
|
|
to all,
Need some tips on how to make a TextBox convert all key entries into
uppercase.
The scheme is:
1. the textfield have the cursor
2. when i enter "r", the textfield now has "R"
3. when i enter "d", the textfield now has "RD"
4. when i enter "2", the textfield now has "RD2"
5. when i enter "Y", the textfield now has "RD2Y"
6. when i reached 4 characters in my textfield, i could no longer enter more
characters.
7. when i insert "f" between "D" and "2", the textfield now has "RDF2".
thanks and regards,
mel :-)
Pinoy Ako! May Reklamo?
Message #2 by =?iso-8859-1?Q?Fredrik_Norm=E9n?= <fredrik.normen@e...> on Thu, 14 Jun 2001 08:09:55 +0200
|
|
hi,
>6. when i reached 4 characters in my textfield, i could no longer enter
more
>characters.
You can set the maxlenght property to 4.
<asp:TextBox maxlength=4 ...... />
Use Javascript to convert key entries into uppercase.
Create a Javascript function and set the onKeyPress property of the textbox
to the functionname.
ex:
<script language="Javascript">
function myFunction(myControl)
{
// myControl is the TextBox object.
//..... Your code here.
// To convert lowercase characters to uppercase,
// you use the function String.toUpperCase
}
</script>
<asp:TextBox onKeyPress="myFunction(this);" ..../>
I hope you know how to create javascript to handle the rest.
Happy coding..
/Fredrik Normén
-----Original Message-----
From: Mel C Solomon [mailto:melsolomon@e...]
Sent: den 14 juni 2001 21:47
To: ASP+
Subject: [aspx] TextBox all uppercase
to all,
Need some tips on how to make a TextBox convert all key entries into
uppercase.
The scheme is:
1. the textfield have the cursor
2. when i enter "r", the textfield now has "R"
3. when i enter "d", the textfield now has "RD"
4. when i enter "2", the textfield now has "RD2"
5. when i enter "Y", the textfield now has "RD2Y"
7. when i insert "f" between "D" and "2", the textfield now has "RDF2".
thanks and regards,
mel :-)
Pinoy Ako! May Reklamo?
Message #3 by "SATHISH C.G." <cgs@s...> on Thu, 14 Jun 2001 10:15:48 +0530
|
|
Hi,
In .Net application we can convert the entries in the text box to
uppercase using one of the methods in the keypresseventargs argument. Its
available in the keychar property. To restrict the user to type 4 characters
use the length property of the textbox. Hope this will help u.
Regards
SATHISH C.G.
----- Original Message -----
From: "Mel C Solomon" <melsolomon@e...>
To: "ASP+" <aspx@p...>
Sent: Friday, June 15, 2001 1:17 AM
Subject: [aspx] TextBox all uppercase
> to all,
> Need some tips on how to make a TextBox convert all key entries into
> uppercase.
> The scheme is:
> 1. the textfield have the cursor
> 2. when i enter "r", the textfield now has "R"
> 3. when i enter "d", the textfield now has "RD"
> 4. when i enter "2", the textfield now has "RD2"
> 5. when i enter "Y", the textfield now has "RD2Y"
> 6. when i reached 4 characters in my textfield, i could no longer enter
more
> characters.
> 7. when i insert "f" between "D" and "2", the textfield now has "RDF2".
>
> thanks and regards,
>
> mel :-)
> Pinoy Ako! May Reklamo?
|
|
 |