Convert to UpperCase while Typing

Hello everyone, now I post a little function which will help you to convert lowerCase to UpperCase while you are typing.

<script language="javascript" type="text/javascript">
function pulsar(e,obj) {
  tecla = (document.all) ? e.keyCode : e.which;
  //alert(tecla);
  if (tecla!="8" && tecla!="0"){
  	obj.value += String.fromCharCode(tecla).toUpperCase();
  	return false;
  }else{
  	return true;
  }
}
</script>
<input type="text" onkeypress="return pulsar(event,this)" />

If you could help me to improve this function your advice is very welcome :smiley:

I hope this will be helpful for someone

<script language="javascript" type="text/javascript">
function pulsar(object) {
  object.value=this.value.toUpperCase();
}
</script>
<input type="text" onkeypress="pulsar(this)" />

–not tested–

 
<script language="javascript" type="text/javascript">
function pulsar(obj) {
  obj.value=obj.value.toUpperCase();
}
</script>
<input type="text" onkeyup="pulsar(this)" />
 

thanks for the advice :smiley: I will check all that recommendations