views:

36

answers:

1

Hello!

jQuery validate has a success option that allows you to perform operations when a user enters valid form data. It typically takes the argument of "label" which is a dynamically inserted tag for displaying a success label (like a checkmark).

I can't retrieve siblings of "label" for some reason and it doesn't appear in Firebug. So I'm wondering how I pass it another parameter. For instance "element" is a jQuery object of the input element.

I want to do something like this but when I alert element it says "undefined"...else where in jQuery validate, element is used.

success: function(element) {
   errorspotholder = element.parents('.rightfields').find('.rederrorx');
   element.removeClass('rederrorx').addClass('norederrorx').qtip('destroy');
            },
A: 

passing the jQuery object element as a global variable from errorPlacement to success worked for me.

see the answer posted on: http://stackoverflow.com/questions/2236243/jquery-validation-errorplacement-success-vs-failure/3285409#3285409

Emile