Hello a warm greeting to the community, today I bring you a new problem which is a simple validation with jquery.validate plugin, the subject is the following I have my form in html:
<div class="container" align="center"><br>
<fieldset><br>
<legend>Busqueda Participantes</legend>
<form class="form-inline" method="post" id="participantes" name="participantes">
<div>
<input type="text" class="form-control" placeholder="Cedula" name="cedula" id="cedula">
<input type="hidden" name="buscar" id="buscar">
</div>
<div class="form-group">
<input type="submit" value="Buscar" class="btn btn-primary" name="buscar" id="buscar">
</div>
</form><br>
</fieldset><br>
</div>
and on the other side my script with the code of jquery validate to validate the field cedula
$(function(){
//$(document).ready(function(){
//$(document).on("ready",function(){
$("#participantes").on("click",function(){
$("#buscar").validate
//errorClass: "error",
alert("LLega hasta aqui");
({
rules:
{
cedula:{required:true,number:true,min:100000,max:99999999}
},
messages:
{
cedula:{required:'Campo Requerido',min:'Minimo 6 numeros',max:'Maximo 8 Numeros',number:'Solo Numeros'}
}
});
});
});
The issue is that he arrives at the alert ("Come up here"); but I do not know why he does not execute the validation messages that I should have already tried and I do not know what to do, please if anyone knows the answer to this question I will be very grateful.