Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/10/2011, 16:16
akaleniuszka
 
Fecha de Ingreso: abril-2010
Mensajes: 6
Antigüedad: 14 años, 11 meses
Puntos: 0
Respuesta: Necesito que me ayuden con codigo PHP y Javascript

Este es el codigo javascript que esta en el mismo documento HTML
Código HTML:
<script languaje="javascript">
function validacion(form)
{
	if(form.Nom_equipo.value == "" || form.Nombre_1.value == "" || form.Apellido_1.value == "" || form.Cedula_1.value == "" || form.Telefono_1.value == "" || form.Email_1.value == "" || form.Nombre_2.value == "" || form.Apellido_2.value == "" || form.Cedula_2.value == "" || form.Telefono_2.value == "" || form.Email_2.value == "")
	{
		alert("Todos los datos son obligatorios, rellenelos por favor.");
		return(false);
	}
	else
	{
		if(form.humano.checked == False)
		{
			alert("Sólo los humanos pueden mandar los datos.");
			return(false);
		}
		else
		{
			if(form.suma.value == "13")
			{
				form.submit();
				return(true);
			}
			else
			{
				if(fomr.suma.value == "")
				{
					alert("Todos los campos son oblogatorios, rellenelos por favor.");
					form.suma.focus;
					return(false);
				}
				else
				{
					alert("La suma está mal, vuelva a intentarlo.");
					form.suma.focus;
					return(false);
				}
			}
		}
	}
}
Y este es el form de la pagina, se que le falta algunas etiquetas, pero las kite para que sea mas corto el mensaje:

Código HTML:
<form action="apgform1.7.php" method="post">
                  <input type="hidden" name="id" value="formulario-pre">
                  <p style="margin-bottom: 0px;">FORMULARIO DE PREINSCRIPCION <span style="font-size: 10px;">(<span style="color: rgb(255,0,0);">FAVOR RELLENAR TODOS LOS CAMPOS</span>)</span></p>
                     <p style="margin-bottom: 0px;">Nombre del equipo:</p>
                     <p style="margin-bottom: 0px;"><input type="text" id="FormsEditField1" name="Nom_equipo" size="33" maxlength="33" style="width: 260px; white-space: pre;"></p>
                     <p style="margin-bottom: 0px;"><span style="font-size: 10px;">Si no tenés equipo, te ayudamos a encontrar compañero, anotá “sin equipo” aquí.</span></p>
                     <p style="margin-bottom: 0px;">Modalidad (trekking o mtb):</p>
                     <p style="margin-bottom: 0px;">
                     	<blockquote>
							<input type="radio" value="Trekking" checked name="Modalidad">Trekking<br>
                            <input type="radio" name="Modalidad" value="MTB">MTB                        </blockquote>
                     </p>
                     <p style="margin-bottom: 0px;"><strong>Integrante 1</strong></p>
                     <p style="text-align: right; margin-bottom: 0px;"><span style="font-size: 12px;">Nombre:</span></p>
                     <p style="margin-bottom: 0px;"><input type="text" id="FormsEditField2" name="Nombre_1" size="30" maxlength="30" style="width: 236px; white-space: pre;"></p>
                     <p style="text-align: right; margin-bottom: 0px;"><span style="font-size: 12px;">Apellido:</span></p>
                     <p style="margin-bottom: 0px;"><input type="text" id="FormsEditField4" name="Apellido_1" size="30" maxlength="30" style="width: 236px; white-space: pre;"></p>
                     <p style="text-align: right; margin-bottom: 0px;"><span style="font-size: 12px;">C.I. Nº:</span></p>
                      <p style="margin-bottom: 0px;">
                        <input type="text" id="FormsEditField5" name="Cedula_1" size="30" maxlength="30" style="width: 236px; white-space: pre;">
                      </p>
                     <p style="text-align: right; margin-bottom: 0px;"><span style="font-size: 12px;">Teléfono:</span></p>
                     <p style="margin-bottom: 0px;"><input type="text" id="FormsEditField7" name="Telefono_1" size="30" maxlength="30" style="width: 236px; white-space: pre;"></p>
                     <p style="text-align: right; margin-bottom: 0px;"><span style="font-size: 12px;">Email:</span></p>
                     <p style="margin-bottom: 0px;">
                       <input type="text" id="FormsEditField6" name="Email_1" size="30" maxlength="30" style="width: 236px; white-space: pre;">
                     </p>
                     <p style="text-align: right; margin-bottom: 0px;"><span style="font-size: 12px;">Remera:</span></p>
                     <p style="margin-bottom: 0px;"><select size="1" name="Remera_1">
                        <option selected value="Pequena">Pequeña</option>
                        <option value="Mediana">Mediana</option>
                        <option value="Grande">Grande</option>
                        </select>
                     </p>
                     <p style="text-align: right; margin-bottom: 0px;"><span style="font-size: 12px;">Nombre:</span></p>
                     <p style="margin-bottom: 0px;"><input type="text" id="FormsEditField3" name="Nombre_2" size="32" maxlength="32" style="width: 252px; white-space: pre;"></p>
                     <p style="text-align: right; margin-bottom: 0px;"><span style="font-size: 12px;">Apellido:</span></p>
                     <p style="margin-bottom: 0px;"><input type="text" id="FormsEditField9" name="Apellido_2" size="32" maxlength="32" style="width: 252px; white-space: pre;"></p>
                     <p style="text-align: right; margin-bottom: 0px;"><span style="font-size: 12px;">C.I. Nº:</span></p>
                     <p style="margin-bottom: 0px;"><input type="text" id="FormsEditField10" name="Cedula_2" size="32" maxlength="32" style="width: 252px; white-space: pre;"></p>
                     <p style="text-align: right; margin-bottom: 0px;"><span style="font-size: 12px;">Teléfono:</span></p>
                     <p style="margin-bottom: 0px;"><input type="text" id="FormsEditField11" name="Telefono_2" size="32" maxlength="32" style="width: 252px; white-space: pre;"></p>
                     <p style="text-align: right; margin-bottom: 0px;"><span style="font-size: 12px;">Email:</span></p>
                     <p style="margin-bottom: 0px;"><input type="text" id="FormsEditField12" name="Email_2" size="32" maxlength="32" style="width: 252px; white-space: pre;"></p>
                     <p style="text-align: right; margin-bottom: 0px;"><span style="font-size: 12px;">Remera:</span></p>
                     <p style="margin-bottom: 0px;"><select size="1" name="Remera_2">
                        <option selected value="Pequena">Pequeña</option>
                        <option value="Mediana">Mediana</option>
                        <option value="Grande">Grande</option>
                        </select></p>
                     <p style="margin-bottom: 0px;"><span style="font-size: 12px;">Soy humano</span>
                       <input type="checkbox" name="humano" value="ON">
                     <p style="text-align: right; margin-bottom: 0px;"><span style="font-size: 12px;">Cuanto es 5+8?</span></p>
                     <p style="margin-bottom: 0px;"><input type="text" id="FormsEditField11" name="suma" size="2" maxlength="2" style="width: 22px; white-space: pre;" >

                       <input type="submit" id="FormsButton1" name="Enviar" value="Enviar" onClick="validacion(this.form)" style="height: 24px; width: 63px;">
                       <input type="reset" value="Restablecer" name="reset"></p>