Field Validation Success Function
I need to invoke a method when a field validation is either successful or unsuccessful. I have managed to get the function to run if the field validation fails by using the following:
- $('#myform').validate({
- rules: {
- client_name: {
- required: true
- }, client_email: {
- required: true
- }
- }, messages {
- client_name: {
- required: function() {
- showBigRedCross('client_name');
- }
- },
- client_email: {
- required: function() {
- showBigRedCross('client_email');
- }
- }
- }
- });
But how do I invoke a method specific to a field that triggers when the field validates successfully? I need to invoke showBigGreenTick(fieldname) for the fields that are valid.
Please help.
On another note, I find it very strange the the documentation is so poor regarding this validation. To even find out that there was a "messages" option for validate was found on another website. There is no mention of it in the docs.