1$("#frmArticle").validate({
2 submitHandler: function(form) {
3 form.submit();
4 },
5 onfocusout: function(element) {
6 //To remove the 'checked' class on the error wrapper
7 var $errorContainer = $(element).siblings(".Ntooltip").find("label");
8 $errorContainer.removeClass("checked");
9 if ( !this.checkable(element)) {
10 this.element(element);
11 }
12 },
13 rules: {
14 name: {
15 required: true
16 }
17 },
18 errorPlacement: function(error, element) {
19 var container = $('<div />');
20 container.addClass('Ntooltip'); // add a class to the wrapper
21 error.insertAfter(element);
22 error.wrap(container);
23 $("<div class='errorImage'></div>").insertAfter(error);
24 },
25 success: function(element) {
26 $(element).addClass("checked");
27 }
28});