I have an input field in which I am trying to add a custom check (required depending on another field). If I put the required character AND funcCall (), I see that two errors are returned. If I just put funcCall, nothing will be returned. I know that it falls into the function and condition because I did console.log (), but for some reason it seems like it needs the original rule in order not to show the error.
Call:
<input type="text" class="validate[funcCall[validatePassportRequired]]" id="form_register_passport_number" value="" name="passport_number" size="50">
Functions:
function validatePassportRequired(field, rules, i, options) { if ($('#register_for').val()!='Local') { return options.allrules.required.alertText; } }
So, if I changed Call to:
class="validate[required, funcCall[validatePassportRequired]]"
I get two * This field is required
Should I have a different validation rule with funcCall?
source share