Ver Mensaje Individual
  #4 (permalink)  
Antiguo 01/01/2009, 11:51
Avatar de marcopoloaz06
marcopoloaz06
 
Fecha de Ingreso: julio-2007
Ubicación: México
Mensajes: 457
Antigüedad: 16 años, 10 meses
Puntos: 11
Respuesta: Posicionar cursor dentro de input text

hola, hice esto aver si te funciona
js:
Código javascript:
Ver original
  1. function tex( th, e ){
  2.     var val = th.value, key = e.keyCode, rel = th.getAttribute("rel");
  3.     if(rel == null){
  4.         th.setAttribute( "rel", val );
  5.         rel = th.getAttribute("rel");
  6.     }
  7.     var oldLength = rel.length, length = val.length;
  8.     if((val.indexOf( rel.substring(0, oldLength) ) == 0
  9.     && (val.substring(0, 1) == rel.substring(0, 1) || length != 0))
  10.     || key == 8 || key == 46){
  11.         th.setAttribute( "rel", val );
  12.     }else{
  13.         th.value = rel;
  14.     }
  15. };
html:
Código HTML:
<input type="text" onkeyup="tex(this, event);"/> 
saludoss y feliz anio nuevo
:]
__________________
Aerolíneas Alicia :D