Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/12/2013, 11:36
bathorz
 
Fecha de Ingreso: agosto-2013
Mensajes: 150
Antigüedad: 11 años, 6 meses
Puntos: 29
Respuesta: Ejecutar script seguido de otro

Este puede ser un modo de hacerlo.
Código HTML:
Ver original
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.    <head>
  4.       <meta charset="utf-8">
  5.       <title></title>
  6.       <script>
  7.          function validar(esto) {
  8.             var valido = false;
  9.             for ( a = 0; a < esto.elements.length; a++) {
  10.               if (esto[a].type == "checkbox" && esto[a].checked == true) {
  11.                  valido = true;
  12.                  break;
  13.               }
  14.            }
  15.            if (!valido) {
  16.               alert("Seleccione una casilla, antes de continuar.");
  17.               return false;
  18.            }
  19.         }
  20.  
  21.         function BorrarUsuarios() {
  22.               if(validar(document.form) == false) return false;
  23.              
  24.               if (confirm("¿Estás seguro que quieres Borrar esto(s) usuario(s)?")) {
  25.                  alert('borrar');
  26.                  return true;
  27.                  //document.location.href = 'borrar-cliente.php?id=<?php echo $row['id_cliente']; ?>';
  28.                } else {
  29.                   alert('no borrar');
  30.                   return false;
  31.                }
  32.             }
  33.       </script>
  34.    </head>
  35.    <body>
  36.       <form name="form" id="form" method="post">
  37.          <input type="checkbox" name="a" />
  38.          <input type="checkbox" name="b" />
  39.          <input type="submit" onclick="BorrarUsuarios();" />
  40.       </form>
  41.    </body>
  42. </html>

Última edición por bathorz; 20/12/2013 a las 11:42