Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/08/2009, 21:13
Airon
 
Fecha de Ingreso: mayo-2003
Mensajes: 6
Antigüedad: 21 años
Puntos: 0
Error validacion en firefox y en Iexplorer si funciona QUE RARO

Código:
<form method="post" action="code.php" onsubmit="return cargar();">
Código:
<script language="JavaScript">
function cargar(){
	valor = document.getElementById("nombre").value;
	valor2 = document.getElementById("banda").value;
	valor3 = document.getElementById("bandaweb").value;
	valor4 = document.getElementById("direlimosna").value;		
	valor5 = document.getElementById("cdglimosna").value;
	valor6 = document.getElementById("email").value;
	valor7 = document.getElementById("email2").value;
    if(valor == null || valor.length == 0 || /^\s+$/.test(valor) ) {
		// Si no se cumple la condicion...
    alert('[ERROR] El campo "Nombre" esta VACIO');
    return false;
  }
  else if( valor2 == null || valor2.length == 0 || /^\s+$/.test(valor) ) {
    // Si no se cumple la condicion...
    alert('Si no dispones de banda,Escribe NO');
    return false;
  }
  else if( valor3 == null || valor3.length == 0 || /^\s+$/.test(valor) ) {
    // Si no se cumple la condicion...
    alert('Si no dispones de web,Escribe NO');
    return false;
  }
  else if( valor4 == null || valor4.length == 0 || /^\s+$/.test(valor) ) {
    // Si no se cumple la condicion...
    alert('[ERROR] El campo "url donaciones" esta VACIO');
    return false;
  }
  else if( valor5 == null || valor5.length == 0 || /^\s+$/.test(valor) ) {
    // Si no se cumple la condicion...
    alert('[ERROR] El campo "codigo" esta VACIO');
    return false;
  }
  else if( valor6 == null || valor6.length == 0 || /^\s+$/.test(valor) ) {
    // Si no se cumple la condicion...
    alert('[ERROR] El campo "Email" esta VACIO');
    return false;
  }
  else if( valor7 == null || valor7.length == 0 || /^\s+$/.test(valor) ) {
    // Si no se cumple la condicion...
    alert('[ERROR] El campo "Repite tu email" esta VACIO');
    return false;
}
  return true;
}
</script>
EN iexplrorer funciona perfecto pero en Firefox NO.

¿algun experto me puede decir el porq?

Tengo conocimientos basicos y he creado este scritp gracias a ejemplos de ustedes.

MUCHAS GRACIAS