Hola
adler. Muchas gracias por la ayuda.
Igual sigo teniendo problemas. Ahora no me pasa bien una variable a una funcion. Le quiero pasar la variable event.
Cita: x=$(document)
x.ready(todoText)
function todoText()
{
$("input[type=text]").bind("keypress", function(){validar(event)})
}
function validar(e) { // 1
tecla = (document.all) ? e.keyCode : e.which; // 2
if (tecla==8) return true; // 3
patron =/[A-Za-z1-9\s]/; // 4
te = String.fromCharCode(tecla); // 5
return patron.test(te); // 6
}
No se cual podra ser la razon.La consola de errores me dice:"event is not defined" Pero no se como lo tengo que mandar.
Ahora si yo en un <input> pongo <input type="text" onkeypress="return validar(event)">
Ahi si me funciona.
¿Cual es mi error?
Desde ya muchas gracias....