hola, hice esto aver si te funciona
js:
Código javascript
:
Ver originalfunction tex( th, e ){
var val = th.value, key = e.keyCode, rel = th.getAttribute("rel");
if(rel == null){
th.setAttribute( "rel", val );
rel = th.getAttribute("rel");
}
var oldLength = rel.length, length = val.length;
if((val.indexOf( rel.substring(0, oldLength) ) == 0
&& (val.substring(0, 1) == rel.substring(0, 1) || length != 0))
|| key == 8 || key == 46){
th.setAttribute( "rel", val );
}else{
th.value = rel;
}
};
html:
Código HTML:
<input type="text" onkeyup="tex(this, event);"/>
saludoss y feliz anio nuevo
:]