posabsolute/jQuery-Validation-Engine — Issue #254: funcCall does not allow called function to set validation status on a empty field
Author: zerohimself
Created: 2012-01-22 02:38:00+00:00
State: open

I was using funcCall to try to proccess muliple fields dependent on one another
I need to be able to validate an empty field depending on the customRegex of another. In any case either phone or email could be empty if the other was valid. but if either one wasn't empty, it would have to validate...

My fix was as follows:
Modify line 592 to this:

if(!required && field.val() == "" && errorMsg!==undefined)
options.isError = false;
// this allows funcCalls to return nothing on an empty field
// and allow said empty field to validate

----------------
now if you add this line somewhere in your code

customRegex: function(field,rules,i,options)
{return methods._customRegex(field,rules,i,options);},

----- you can do the following
notice the class=".. validate[funcCall[validateContacts[phone]]]" part

...