I may not be sure what you're wanting but something like this may help: ... $("#billingAddress").val() == $("#shippingAddress").val() && $ ("#comparefields").is(":checked");
I presumed you are wanting to compare the billingAddress and shippingAddress values. George On Mar 3, 4:13 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > How can I compare 2 text fields only if a certain checkbox is > checked? Can you do something like this? > > billingAddress: { > required: true > minlength: 5 > equalTo: "#shippingAddress" && function(element) { > return jQuery("#comparefields").is(":checked"); > > },