Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
175
rated 0 times [  176] [ 1]  / answers: 1 / hits: 22944  / 13 Years ago, tue, june 21, 2011, 12:00:00

I'm new to jQuery.



Working with jQuery validation plugin & cufon at the same time is giving me really hard time.



Basically, I want to detect event once jQuery Validation did what it had to do and call Cufon.refresh() straight after it.



$('#commentForm').validate({
rules: {
password: {
required: true,
minlength: 8,
maxlength: 8,
number: true
},
}
});


We are expecting <label class=error> SOME TEXT </label> when form is not valid.



And once that created I want to Cufon.refresh() on that label created by jQuery Validation.
How can I detect when jQuery Validation is done, and call something based on that event?



Any help much appreciated.
Regards,
Piotr


More From » jquery

 Answers
33

Thanks to @Ariel - if there is a 'success' there has to be a 'not-success' as well, so..



Working code:



$('#commentForm').validate({
rules: {
password: {
required: true,
minlength: 8,
maxlength: 8,
number: true
}
},
showErrors: function(errorMap, errorList) {
this.defaultShowErrors();
Cufon.refresh();
//alert('not valid!')
},
success: function() {
//alert('valid!')
}
});


Thanks again for the idea!


[#91598] Monday, June 20, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
longd

Total Points: 616
Total Questions: 110
Total Answers: 101

Location: Andorra
Member since Sat, May 27, 2023
1 Year ago
;