Ver Mensaje Individual
  #9 (permalink)  
Antiguo 19/10/2007, 11:16
Avatar de rol2007
rol2007
 
Fecha de Ingreso: mayo-2007
Ubicación: Santiasco CHILE
Mensajes: 300
Antigüedad: 17 años
Puntos: 4
Re: Problemilla con onkeyUp

ya encontre uno re bueno :D
Código:
function upperCase(e) { 
  tecla = (document.all) ? e.keyCode : e.which; 
  if(tecla == 9 || tecla == 0) return true; 
  if(tecla == 8) return true; 
  if(window.Event){ 
      var pst = e.currentTarget.selectionStart; 
      var string_start = e.currentTarget.value.substring(0,pst); 
      var string_end = e.currentTarget.value.substring(pst ,e.currentTarget.value.length); 
      e.currentTarget.value = string_start+ String.fromCharCode(tecla).toUpperCase()+ string_end; 
      e.currentTarget.selectionStart = pst + 1; 
      e.currentTarget.selectionEnd = pst + 1; 
      e.stopPropagation(); 
      return false; 
  } 
  else { 
    te = String.fromCharCode(tecla); 
    te = te.toUpperCase(); 
    num = te.charCodeAt(0); 
    e.keyCode = num; 
  } 
}

Cita:
<td><input name="${status.expression}" type="text" id="Nombre" class="big" value="$!status.value" onkeypress="return upperCase(event)" alt="blank" maxlength="50">#foreach($error in $status.errorMessages) <b><label color="red">$error</label></b> <br> #end</td>
ahora el problema que tengo es que antes tenia un onkeypress="return SoloLetras(event)" se puede utilizar 2 funciones?
o que podria usar para escribir solo letras y no numeros y que queden en mayusculas??

gracias :D
otra vez