• Post Reply Bookmark Topic Watch Topic
  • New Topic

jquery don't work correctly  RSS feed

 
ives rodriguez
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just working jquery validation of empty fields, jquery validation of number of characters and jquery validation of numerical does not work.

  

         <%@page contentType="text/html" pageEncoding="UTF-8"%>
            <!DOCTYPE html>
            <html>
            <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
            <link href="css/table.css" rel="stylesheet" type="text">
            <link rel="stylesheet" type="text/css" href="estilo.css">
            <style type="text/css">
            </style>
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                        <title>Crear registro de una Persona</title>
            <script type="text/javascript" src="jquery-3.2.1.min"></script>   
            <script type="text/javascript" src="jquery.validate.min"></script>   
            <script type="text/javascript">
            $(document).ready(function() {
            $('#createPersonForm').validate({
            rules: {
            
            rut: {
            required: true,
            number: true,
            minlength:7
            },
            nombre:{
            required: true,
            minlength:3
            },
            apellido:{
            required: true,
            minlength:4
            },
          
            });
       
            </script>           
            </head>
            <body>
                <h1>Crear una Persona</h1>
                <form id="createPersonForm" action="crearPersona.do" method="post">
            <div class="navbar navbar-fixed-center">
            <table>
            <tr><td>Rut:</td><td><input type="text" id="rut" name="rut"    required/><span id="dato1"></span></td></tr>
       
            <tr><td>Nombre:</td><td><input type="text" id="nombre" name="nombre" required/><span id="dato2"></span></td></tr>
       
            <tr><td>Apellidos:</td><td><input type="text" id="apellido" name="apellido" required/><span id="dato3"></span></td></tr>
       
            </table>
            <div class="navbar-inner"> 
            <br/>   
            <input type="submit" class="btn btn-info" id="CrearRegistro"   value="CrearRegistro" />
            </div>
    </div>
            </form>
            </html>

when entering a quantity less than the minimum, does not make any validation.
only accept numbers in rut, when you enter letters accept them.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!