xVal ignoring fields that are hidden
- by gmcalab
I have a form where a user can toggle receiving funds either via check or via electronic transfer. When they choose either way in a list box, the respective part of the form hides. If they choose electronic transfer only bank info fields show, if they choose via check only address info shows and the bank fields are hidden.
Well, since they choose one way or another I want to, not validate for something that is hidden. (Client Side)
Is there a way to set xVal to only validate fields that are not visible?
I tried to override validate with the following but no dice...
$('#EditPayment').validate({
elementwhichishidden: {
required: function(element) {
return ($(element).parent().parent().css('display') != 'none');
}
}
});