Note:
This question refers to a very old version of jQuery.validate() (version 1.5). This plugin now provides a built-in solution for doing this: the .r
The "required" declarations inside of the validate.rules hash do not have to be statically declared as "true". You can actually supply an anonymous function instead which can check for the visibility of something and return true or false depending on the answer.
$('form').validate({
rules: {
rightform_input1: {
required: function(){
return $('#leftform').css("visibility") !== "hidden"
} },
rightform_input2: {
required: function(){
return $('#leftform').css("visibility") !== "hidden"
} }
}
});