Hello jQuery community,

What i'm trying to do is very simple yet it is probably not easy. I've
configured the validation plugin that it works the way i want it to
work. Now i want a kinda 'callout' action on on particular error that
i use the validation 'remote' option. In the message are i add cluetip
into the config of the validation like this:

$(element).cluetip({sticky: true, local: true, showTitle: false,
attribute:"title"});

But it does not work in this manner. so maybe im doing something wrong
with cluetip or i should apply it differently to validation plugin.
But here below my whole validation code:

$(document).ready(function() {
         $("#dvOrganization form").validate({
             errorClass: "errorClass",
             ignoreTitle: true,
             errorPlacement: function(error, element) { },
             rules: {
                 Name: {
                     required: true,
                     minlength: 2,
                     remote: {
                         url: '/Organization/VerifyOrganizationName/',
                         type: 'GET',
                         dataType: 'json',
                         data: {
                             Name: function() {
                                 return $('#Name').val();
                             }
                         }
                     }
                 },
                 Category: {
                     required: true,
                     minlength: 1,
                     digits: true
                 },
                 Country: { required: true }

             },
             messages: {
                 Name: {
                     required: "",
                     minlength: "",
                     remote: function(element) {
                     $(element).cluetip({sticky: true, local: true,
showTitle: false, attribute:"title"});
                     }
                 },
                 Category: ""
             },
             focusInvalid: false,
             onkeyup: false,
             onfocusout: false,
             highlight: function(element, errorClass) {
                 $(element).addClass(errorClass);

             },
             unhighlight: function(element, errorClass) {
                 $(element).removeClass(errorClass);

             }
         });

     });

Reply via email to