Ver Mensaje Individual
  #7 (permalink)  
Antiguo 28/11/2010, 20:37
Avatar de carlos_belisario
carlos_belisario
Colaborador
 
Fecha de Ingreso: abril-2010
Ubicación: Venezuela Maracay Aragua
Mensajes: 3.156
Antigüedad: 14 años
Puntos: 461
Respuesta: Validar varios form similares en una página, c/igual nombre de campo radio

pues fijate lo hice aca y me funciono bien no se cual sea tu problema
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <title>Documento sin t&iacute;tulo</title>
  5. <script type="text/javascript">
  6. function validar(form){        
  7.     if (form.nombre[0].checked==true || form.nombre[1].checked==true){     
  8.         alert("Lo hizo");
  9.         return true;
  10.     }
  11.     else{
  12.         alert("no lo hizo");
  13.         return false
  14.     }      
  15. }
  16. </head>
  17. <form name="form1" action="" method="post" onsubmit="return validar(this)">
  18.     <input type="radio" value="borrar" name="nombre" >Borrar <br>
  19.     <input type="radio" value="borrar" name="nombre" >Mal<br>
  20.     <input type="submit" value="...">
  21. </form>
  22. <form name="form2" action="" method="post" onsubmit="return validar(this)">
  23.     <input type="radio" value="borrar" name="nombre" >Borrar <br>
  24.     <input type="radio" value="borrar" name="nombre" >Mal<br>
  25.     <input type="submit" value="...">
  26. </form>
  27. </body>
  28. </html>
pruebalo y me avisas saludo
__________________
aprende d tus errores e incrementa tu conocimientos
it's not a bug, it's an undocumented feature By @David
php the right way