Conditional Client Side Valdations For Optional Address Section

i have to show form with home address fields like street address,zipcode etc and then a checkbox for mailing address ‘same as above’. user fill home address fields and then check the checkbox as ‘same as above’ or user uncheck the checkbox then an another address fileds section same as home address section in same form appears for mailing address.when both address fields shows it works fine but when user ticks ‘same as above’.it gives validation for hidden address fields section i.e. mailing address.

i had solved this problem by putting conditional validation in controller but how can i solve it for client site validation?

i got this at stackoverflow

can somebody tell me how to implement the solution given below

var settings = $(myform).data(‘settings’);

settings.attributes.push({

…Validation settings here

});

$(myform).data(‘settings’, settings);

my exact question is –

how to do client side validation for dynamically created fields?