Ver Mensaje Individual
  #9 (permalink)  
Antiguo 17/06/2003, 13:46
Avatar de Kaopectate
Kaopectate
Colaborador
 
Fecha de Ingreso: diciembre-2001
Ubicación: Curaçao (Antillas Holandesas)
Mensajes: 3.179
Antigüedad: 23 años, 2 meses
Puntos: 38
------------------------------------ Posterior ------------------------------------
Prueba asi:

Código PHP:
    <SCRIPT LANGUAGE="javascript">
    <!--


       function 
CheckField(frm)
       {
       var 
retour 1;

         
//******* Initialisation
         
frm.Nom.style.backgroundColor="#FFFFFF";
         
frm.Cognom.style.backgroundColor="#FFFFFF";
         
frm.Email.style.backgroundColor="#FFFFFF";
         
frm.Tel.style.backgroundColor="#FFFFFF";
         
frm.Pregunta.style.backgroundColor="#FFFFFF";


         
//********* Test
         
if ( frm.Nom.value == "")
         {
             
frm.Nom.style.backgroundColor="#FFB6C1";
             
retour=0;
         }
         if ( 
frm.Cognom.value == "")
         {
             
frm.Cognom.style.backgroundColor="#FFB6C1";
             
retour=0;
         }
         if ( 
frm.Email.value == "")
         {
             
frm.Email.style.backgroundColor="#FFB6C1";
             
retour=0;
         }
         if ( 
frm.Tel.value == "")
         {
             
frm.Tel.style.backgroundColor="#FFB6C1";
             
retour=0;
         }
         if ( 
frm.Pregunta.value == "")
         {
             
frm.Pregunta.style.backgroundColor="#FFB6C1";
             
retour=0;
         }
if (
frm.Email.value.indexOf('@'0) == -||
frm.Email.value.indexOf('.'0) == -1) {
alert("Dirección de e-mail inválida");
frm.Email.focus();
return 
false;
}
         return 
retour;


       }

       function 
NextPage()
       {
         
document.form.submit();
       }

       function 
Check(frm)
       {
              if ( 
CheckField(frm)=='0')
        {
            
window.alert("Ha d’omplir els camps, si us plau !");
        }
        else
        {
           
NextPage();
        }

       }


    -->
</script> 
Y deja la llamada a la función como te dije en un principio:

Check(document.pro)

Dime si funciona.

Saludos.

------------------------------------ Posterior ------------------------------------
Olvida mis pruebas, haz lo que te dice tunait.

Saludos.