I am using jquery validation to validate a form. It works fine when it comes to validate simple variables or even and array variable but here is the thing: I need to validate an array of arrays.
My code looks something like this:
<input type="text" name="phones[0][prefix]" />
<input type="text" name="phones[0][number]" />
<input type="text" name="phones[1][prefix]" />
<input type="text" name="phones[1][number]" />
The number of phones fields are unlimited so I might have one or more.
The validation that I need to apply consists in checking that both prefix and number are not empty for each phone.
Does anybody have and idea of how to make the validation for this case. Anything I read so far has helped me.
Thanks in advance.
$('input[name*=phones]'), orconsole.log($('input[name*=prefix]'))$('input[name*=prefix]')selector, with custom messages :)