Codigo:
Código HTML:
<!DOCTYPE html> <html lang="es"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>Mis tareas</title> <link type="text/css" href="estilos/smoothness/jquery-ui-1.10.4.custom.css" rel="stylesheet"> <link type="text/css" href="estilos/bootstrap/bootstrap.min.css" rel="stylesheet" media="screen"> <link type="text/css" href="estilos/signin.css" rel="stylesheet"> <link type="text/css" href="estilos/estilo.css" rel="stylesheet"> <script type="text/javascript" src="js/jquery-1.11.0.js"></script> <script type="text/javascript" src="js/jquery_ui/jquery-ui-1.10.4.custom.min.js"></script> <script type="text/javascript" src="js/bootstrap/bootstrap.min.js"></script> <script type="text/javascript" src="js/jquery-validation-1.11.1/dist/jquery.validate.min.js"></script> <script type="text/javascript" src="js/jquery-validation-1.11.1/lib/jquery.form.js"></script> <script type="text/javascript" src="js/jquery-validation-1.11.1/localization/messages_es.js"></script> </head> <script type="text/javascript"> $(function(){ //creación de ventana formulario $('#formulario').dialog({ autoOpen:false, modal:true, width:305, height:'auto', resizable: false, close:function(){ $('#formRegistro fieldset > span').removeClass('error').empty(); $('#formRegistro input[type="text"]').val(''); } }); // funcionalidad del botón que abre el formulario $('#irnuevoUser').on("click",function(){ $('#formulario').dialog("open"); }); // Validar Formulario $('#formRegistro').validate({ submitHandler: function(){ var str = $('#formRegistro').serialize(); alert(str); return false; }, errorPlacement: function(error, element) { error.appendTo(element.prev("span").append()); } }); }); </script> <body> <div class="hidden" id="formulario" Title="Registrarse"> <form action="" method="POST" id="formRegistro" name="formRegistro" role="form"> <fieldset id="datosUser"> <div class="form-gorup"> <label for="nombres">Nombres</label> <span></span> <input type="text" id="nombres" name="nombres" placeholder="Nombres" class="form-control" required autofocus> </div> <div class="form-gorup"> <label for="apellidos">Apellidos</label> <span></span> <input type="text" id="apellidos" name="apellidos" placeholder="Apellidos" class="form-control " required> </div> <div class="form-gorup"> <label for="nick">Nombre de Usuario</label> <span></span> <input type="text" id="nick" name="nick" placeholder="Nombre Usuario" class="form-control " required> </div> <div class="form-gorup"> <label for="pass">Contraseña</label> <span></span> <input type="password" id="pass" name="pass" placeholder="Contraseña" class="form-control " required> </div> <div class="form-gorup"> <label for="rpass">Repetir contraseña</label> <span></span> <input type="password" id="rpass" name="rpass" placeholder="Repetir contraseña" class="form-control " required> </div> <div class="form-gorup"> <label for="email">Email</label> <span></span> <input type="email" id="email" name="email" placeholder="Email" class="form-control" required> </div> <div class="form-gorup"> <label for="departamento">Departamento</label> <span></span> <input type="text" id="departamento" name="departamento" placeholder="Departamento" class="form-control " required> </div> </fieldset> <button class="btn btn-lg btn-primary btn-block" type="submit">Continuar</button> <!--<fieldset id="ajaxLoader" class="ajaxLoader hide"> <img src="images/default-loader.gif"> <span>Espere un momento...</span> </fieldset> --> </form> </div> <div class="wrapper"> <section class="container"> <form class="form-signin" role="form" action="include/login.php" method="POST"> <h2 class="form-signin-heading">Inciar sesión</h2> <input type="text" class="form-control" placeholder="Usuario" name="nick" id="nick" required autofocus> <input type="password" class="form-control" placeholder="Password" name="pass" id="pass" required> <button class="btn btn-lg btn-primary btn-block" type="submit">Entrar</button> </form> <div id="btnAddUser" class="center addUser"> <button id="irnuevoUser" class="btn btn-default btn-block" role="button">Registrarse</button> </div> </section> </div> </body> </html>