Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/08/2012, 18:26
Peisithanatos
 
Fecha de Ingreso: agosto-2012
Mensajes: 2
Antigüedad: 11 años, 9 meses
Puntos: 0
Respuesta: Problema con envío de formulario

Tienes razón. Fallo técnico. Ahí va:

Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Formulario de contacto</title>
<script type="text/javascript">
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }
</script>
</head>

<body>
<form action="php.php" method="post" name="form1" id="form1" onsubmit="MM_validateForm('nombre','','R','correo','','RisEmail','telefono','','NisNum','mensaje','','R');return document.MM_returnValue">
  <table width="500" border="0" cellspacing="5">
    <caption>
      Formulario de contacto
    </caption>
    <tr>
      <td align="right"><label for="nombre">Nombre*:</label></td>
      <td align="left"><input type="text" name="nombre" id="nombre" /></td>
    </tr>
    <tr>
      <td align="right"><label for="apellidos">Apellidos:</label></td>
      <td align="left"><input type="text" name="apellidos" id="apellidos" /></td>
    </tr>
    <tr>
      <td align="right"><label for="correo">Correo electrónico*:</label></td>
      <td align="left"><input type="text" name="correo" id="correo" /></td>
    </tr>
    <tr>
      <td align="right"><label for="telefono">Teléfono:</label></td>
      <td align="left"><input name="telefono" type="text" id="telefono" maxlength="9" /></td>
    </tr>
    <tr>
      <td align="right"><label for="cliente">Cliente:</label></td>
      <td align="left"><input name="radio" type="radio" id="cliente" value="particular" checked="checked" />
        Particular 
        <input type="radio" name="radio" id="radio" value="ed" />
        Ed 
        <input type="radio" name="radio2" id="radio2" value="empresa" /> 
        Empresa</td>
    </tr>
    <tr>
      <td align="right"><label for="servicio">Tipo de servicio*:</label></td>
      <td align="left"><select name="servicio" id="servicio">
        <option value="i" selected="selected">I</option>
        <option value="r">R</option>
        <option value="o">O</option>
        <option value="e">C</option>
        <option value="a">A</option>
        <option value="otro">Otro</option>
      </select></td>
    </tr>
    <tr>
      <td align="right"><label for="mensaje">Mensaje*:</label></td>
      <td align="left"><textarea name="mensaje" id="mensaje" cols="45" rows="5"></textarea></td>
    </tr>
    <tr>
      <td align="right"><input type="reset" name="restablecer" id="restablecer" value="Restablecer" /></td>
      <td align="left"><input type="submit" name="enviar" id="enviar" value="Enviar" /></td>
    </tr>
  </table>
</form>
<a href="http://www.000webhost.com/" target="_blank">http://www.000webhost.com/</a>
</body>
</html> 
Un saludo!