Ver Mensaje Individual
  #4 (permalink)  
Antiguo 15/01/2011, 17:40
Avatar de soypepepompin
soypepepompin
 
Fecha de Ingreso: noviembre-2010
Mensajes: 106
Antigüedad: 13 años, 5 meses
Puntos: 1
Respuesta: validacion de formulario error

Modifique lo que has agregado en tu edicion de tu respusta pero esta peor...


Código PHP:


<!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</title>



<SCRIPT LANGUAGE="JavaScript"> 
function valida_envia() { 

var s = false;
    with (document.forms['form'])
    { 
        for ( var i = 0; i < plan.length; i++ ) 
        { 
            if ( plan[i].checked ) 
            { 
                s= true; 
                //window.alert("Ha seleccionado: \n" + plan[i].value);
                return plan[i].focus();

            } 
        } 
    
        if (s)
        { 
        window.alert("Debes seleccionar un plan" ) ;     
        return;
        } 
    } 

form.submit();


</SCRIPT> 


</head>

<body>
    
    <form name="form" action="" method="post" enctype="multipart/form-data">
      <p><input name="plan" type="radio" value="1" <?php echo $activado1 ?> />
      Opcion 1</p>
      <p>
        <input type="radio" name="plan" value="2" <?php echo $activado2 ?>/>
      Opcion 2</p>
      <p>
        <input type="radio" name="plan" value="3" <?php echo $activado3 ?>/>
      Opcion 3</p>
      <p>
        <input name="plan" type="radio" value="4" <?php echo $activado4 ?> /> 
        Opcion 4      </p>
      <p>
        <input name="plan" type="radio" value="5" <?php echo $activado5 ?> />
        Opcion 5      </p>
      <p>
        <input name="plan" type="radio" value="6" <?php echo $activado6 ?> /> 
      Opcion 6</p>
      <p>
      
       <input type="button" onclick="location.href = 'atras.php?mod=1'" value="&lt; Anterior" class="bot1-2"> 
        
       &nbsp;
              
       <input name="button" type="button" class="bot1" onclick = "this.form.action = 'prosesa.php'; this.form.target = '_self';  valida_envia();" value="Siguiente &gt;" />
</p>
      
</form>

</body>
</html>