« Back to Plugins/Validation
$("#myform").validate(); $("a.check").click(function() { alert("Valid: " + $("#myform").valid()); return false; });
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript" src="http://jzaefferer.github.com/jquery-validation/jquery.validate.js"></script> <script> $(document).ready(function(){ $("#myform").validate(); $("a.check").click(function() { alert("Valid: " + $("#myform").valid()); return false; }); }); </script> </head> <body> <form id="myform"> <input type="text" name="name" class="required" /> <br/> <a href="#" class="check">Validate!</a> </form> </body> </html>