jQuery validation plugin not validating the fields onblur and onkeyup -


i using jquery validation plugin validate form data. works fine on form submit. onkeyup , onblur not working.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" ></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.0/jquery.validate.js"></script> 

jquery code:

var validator = $("#myform").validate( {          rules:{             attribute: "required",             attributevalue: "required email"         },         messages:{             attribute: "required",             attributevalue: {                 required: "enter email",                 email: "enter valid email"             }         }     }); 

am doing wrong here?

$("#element").blur(function(){    $(this).validate({       // code here    }) }) 

or more precisely

$('#myform').blur(function(){     validator.validate() }); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -