Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/02/2009, 05:14
mapete
 
Fecha de Ingreso: febrero-2009
Mensajes: 4
Antigedad: 15 aos, 3 meses
Puntos: 0
Script funciona en IE y Safari, pero no en Mozilla Firefox

El script en cuestin es el siguiente:

function validar(formulario) {

if (valora.interesado.value.length < 6) {
alert("Escriba por lo menos 6 caracteres en el campo Interesado.");
valora.interesado.focus();
return (false);
}
var checkOK = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚ" + "abcdefghijklmnñopqrstuvwxyzáé*óú ";
var checkStr = valora.interesado.value;
var allValid = true;
for (i = 0; i < checkStr.length; i++) {
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length) {
allValid = false;
break;
}
}
if (!allValid) {
alert("Escriba slo letras en el campo Interesado.");
valora.interesado.focus();
return (false);
}

return (true);
}

Y luego tenemos un formulario html...

<FORM METHOD="POST" ACTION="" name="valora" onSubmit = "return validar(this)">
<INPUT TYPE="TEXT" NAME="interesado" size="50" maxlength="200" value="valor">
...


El script se repite un montn de veces (es un formulario extenso), y no doy con el problema.
Gracias a todos.