I'm trying to do some validation on 2 numerical fields and not done much JQuery validation this year.

-Product A comes with Product B.
-You can have unlimited amount of Product A
-But Product B can only have the same or less than Product A

For example:
If Product A qty is 5 then product B can be 1 to 5.

I have tried an validation.addmethod but ended up all confussed. The product ids for A and B are autogenerated but i it is possible to matach Product B to A.

Any ideas?