Sam
|
| Posted: 03/17/2005, 2:56 AM |
|
Hi
Does anyone know if it is possible to set the input to a textbox to uppercase, so that when a user types in the textbox, it automatically changes it to caps as they are typing regardless of whether or not CAPS LOCK is on/off on users PC. (Have tried Ucase, but that returns - am not returning, just displaying). Hope someone can help as i am really in a pickle!
Thanks
Sam
|
|
|
 |
dataobjx
Posts: 181
|
| Posted: 03/17/2005, 5:38 AM |
|
Try This;
Method 1<input type="text"
onkeydown="f(this)"
onkeyup="f(this)"
onblur="f(this)"
onclick="f(this)" />
Method 2<input type="text"
onattrmodified="g(this)"
onpropertychange="g(this)" />
<script type="text/javascript">
function f(o){
o.value=o.value.toUpperCase().replace(/([^0-9A-Z])/g,"");
}
function g(o){
if(/[^0-9A-Z]/.test(o.value)){
o.value=o.value.toUpperCase().replace(/([^0-9A-Z])/g,"");
}
}
_________________
www.DataObjx.net
www.mydigitalapps.com |
 |
 |
Tuong Do
|
| Posted: 03/20/2005, 6:02 PM |
|
Use this
<input style="TEXT-TRANSFORM: uppercase"
onchange="this.value=this.value.toUpperCase()" bla bla bla >
"Sam" <Sam@forum.codecharge> wrote in message
news:24239627838b99@news.codecharge.com...
> Hi
>
> Does anyone know if it is possible to set the input to a textbox to
> uppercase,
> so that when a user types in the textbox, it automatically changes it to
> caps
> as they are typing regardless of whether or not CAPS LOCK is on/off on
> users
> PC. (Have tried Ucase, but that returns - am not returning, just
> displaying).
> Hope someone can help as i am really in a pickle!
>
> Thanks
>
> Sam
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|