Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/06/2006, 12:08
lobo negro
 
Fecha de Ingreso: abril-2006
Mensajes: 34
Antigüedad: 18 años, 9 meses
Puntos: 0
necesito ayuda con este script

Haber si me podriais ayudar, necesito añadir a mi script un codigo para impedir que el siguiente formulario pueda ser reenviado, preferiblemente que salga una alerta diciendo que ya ha sido enviado al darle al boton enviar y no permita el reenvio.
Código:
<html>
<head>
<title>Formulario</title>
<script LANGUAGE="JavaScript">

function Validar(form)
{
  if (form.Nombre.value == "")
  { alert("Por favor escriba su nombre"); form.Nombre.focus(); return; }

  if (form.Apellidos.value == "")
  { alert("Por favor escriba sus apellidos"); form.Apellidos.focus(); return; }

  if (form.Pais.value == "")
  { alert("Por favor indique su pais"); form.Pais.focus(); return; }

  if (form.Provincia.value == "")
  { alert("Por favor indique su provincia"); form.Provincia.focus(); return; }

  if (form.Ciudad.value == "")
  { alert("Por favor indique su ciudad"); form.Ciudad.focus(); return; }

  if (form.Domicilio.value == "")
  { alert("Por favor indique su domicilio"); form.Domicilio.focus(); return; }

  if (form.CodPost.value == "")
  { alert("Por favor escriba su código de su codigo postal"); form.CodPost.focus(); return; }
 
  if (form.Email.value == "")
  { alert("Por favor escriba su dirección de e-mail"); form.Email.focus(); return; }

  if (form.Email.value.indexOf('@', 0) == -1 ||
      form.Email.value.indexOf('.', 0) == -1)
  { alert("Dirección de e-mail inválida"); form.Email.focus(); return; }

  if (form.Telefono.value == "")
  { alert("Por favor escriba su número de teléfono"); form.Telefono.focus(); return; }

  if (!form.checkbox.checked)
  { alert("Debe aceptar los Terminos y Condiciones");form.checkbox.checked; return; }

  form.submit();
}

</script>
</head>

<body text="#FFFF00" bgcolor="#000000">
<form method="post" action="enviarform.php">
<div align="center"><center>

<table border="0" cellpadding="0" cellspacing="0" width="100%" height="147">
  <tr>
    <td width="15%" height="21">&nbsp; Nombre:</td>
    <td width="21%" height="21"><input type="text" name="Nombre" size="15"></td>
    <td width="15%" height="21">&nbsp; Apellidos:</td>
    <td width="21%" height="21"><input type="text" name="Apellidos" size="15"></td>
  </tr>
  <tr>
    <td width="15%" height="23">&nbsp; Pais: </td>
    <td width="21%" height="23"><input type="text" name="Pais" size="15"></td>
    <td width="15%" height="23">&nbsp; Provincia:</td>
    <td width="21%" height="23"><input type="text" name="Provincia" size="15"></td>
  </tr>
  <tr>
    <td width="15%" height="23">&nbsp; Ciudad:</td>
    <td width="21%" height="23"><input type="text" name="Ciudad" size="15"></td>
    <td width="15%" height="23">&nbsp; Domicilio:</td>
    <td width="21%" height="23"><input type="text" name="Domicilio" size="15"></td>
  </tr>
  <tr>
    <td width="15%" height="21">&nbsp; Codigo Postal:</td>
    <td width="21%" height="21"><input type="text" name="CodPost" size="15"></td>
    <td width="15%" height="21">&nbsp; E-mail:</td>
    <td width="21%" height="21"><input type="text" name="Email" size="15"></td>
  </tr>
  <tr>
    <td width="15%" height="23">&nbsp; Telefono:</td>
    <td width="21%" height="23"><input type="text" name="Telefono" size="15"></td>
    <td width="15%" height="23">&nbsp; Fecha de Nac.:</td>
    <td width="21%" height="23"><input type="text" name="Dia" size="2"><select name="Mes"
    size="1">
      <option value="Enero">Enero</option>
      <option value="Febrero">Febrero</option>
      <option value="Marzo">Marzo</option>
      <option value="Abril">Abril</option>
      <option value="Mayo">Mayo</option>
      <option value="Junio">Junio</option>
      <option value="Julio">Julio</option>
      <option value="Agosto">Agosto</option>
      <option value="Septiembre">Septiembre</option>
      <option value="Octubre">Octubre</option>
      <option value="Noviembre">Noviembre</option>
      <option value="Diciembre">Diciembre</option>
    </select><input type="text" name="año" size="4"></td>
  </tr>
</table>
</center></div><div align="center"><center>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td width="100%"><div align="center"><center><table border="0" cellpadding="0"
    cellspacing="0" width="100%">
      <tr>
        <td width="100%"><p align="center"><big><big>Importante:</big></big></td>
      </tr>
      <tr>
        <td width="100%"><p align="center"><textarea rows="4" name="texto" cols="40"><textarea></td>
      </tr>
      <tr>
        <td width="100%"><p align="center"><input TYPE="checkbox" name="checkbox"><font
        color="#FFFF00"> Acepto los Terminos y Condiciones.</font></td>
      </tr>
      <tr>
        <td width="100%"><p align="center"><font face="Arial" color="#000000"><small><input
        type="submit" value="Enviar" onClick="Validar(this.form)"><input TYPE="reset"></small></font></td>
      </tr>
    </table>
    </center></div></td>
  </tr>
</table>
</center></div>
</form>
</body>
</html>