I have two fields (mobile and telephone) which are both being validated by the Validation plugin for jquery although Im struggling to get it working..
One of the fields must be populated although Im failing to successfully validation that checks on of the fields and it that has a value to allow the other field to pass validation, even though its empty.
Is there an easy way to do this? I’ve tried add my own rules but I cant get it working 🙁
many thanks
requiredcan take a callback function to determine if the validation should apply, so something like this should work:Tweaking the functions as necessary.
Edit: relevant docs link http://docs.jquery.com/Plugins/Validation/Methods/required#dependency-expression