Ver Mensaje Individual
  #10 (permalink)  
Antiguo 17/06/2003, 13:58
Avatar de da2
da2
 
Fecha de Ingreso: abril-2003
Ubicación: Catalunya
Mensajes: 239
Antigüedad: 21 años, 11 meses
Puntos: 0
Tunait
con esto ni mira la validacion. Pasa directament a mandar el formulario.

Un saludo

Kaopectate
lo que haces cambiar los form de la funcion por frm?

Un saludo

Este es el codigo de todo el formulario por si alguien tiene una solución.
Código:
<HTML>
<HEAD>
<TITLE>Contactar Pa d'Àngel</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
	<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) == -1 ||
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>
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 background="fotos/backs.jpg">
<table border="0" width="800" background="fotos/back.gif" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="100%">
                    <form action="/cgi-bin/formail.pl" method="POST" NAME="pro">
					  <input type=hidden name="recipient" value="[email protected]">
					  <input type=hidden name="sort" value="order:Nom,Cognom,Email,Telefon,Pregunta">
					  <input type=hidden name="subject" value="Consulta">
                      <table border="0" width="100%" cellpadding="0">
                        <tr>
                          <td width="30%" align="right" valign="top" bgcolor="#796342"><font color="#FFFFFF" size="2" face="Arial">Nom:</font></td>
                          <td width="70%" bgcolor="#796342"><input type="text" name="Nom" size="30"></td>
                        </tr>
                        <tr>
                          <td width="30%" align="right" valign="top" bgcolor="#796342"><font color="#FFFFFF" size="2" face="Arial">Cognom:</font></td>
                          <td width="70%" bgcolor="#796342"><input type="text" name="Cognom" size="30"></td>
                        </tr>
                        <tr>
                          <td width="30%" align="right" valign="top" bgcolor="#796342"><font color="#FFFFFF" size="2" face="Arial">E-mail:</font></td>
                          <td width="70%" bgcolor="#796342"><input type="text" name="Email" size="30"></td>
                        </tr>
                        <tr>
                          <td width="30%" align="right" valign="top" bgcolor="#796342"><font color="#FFFFFF" size="2" face="Arial">Telèfon:</font></td>
                          <td width="70%" bgcolor="#796342"><input type="text" name="Tel" size="12"></td>
                        </tr>
                        <tr>
                          <td width="30%" align="right" valign="top" bgcolor="#796342"><font color="#FFFFFF" size="2" face="Arial">Pregunta:</font></td>
                          <td width="70%" bgcolor="#796342"><textarea rows="3" name="Pregunta" cols="27"></textarea></td>
                        </tr>
                      </table>
					  <font face="Arial" size="2">
					  <p align="center"><input type="image" src="../imagenes/cal.jpg" value="OK" onClick="Check(document.pro);">
					  </font>

                    </form>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>

Un saludo a todos y gracias por vuestro esfuerzo.