I was hoping to be able to do something like this to make another field required based on a drop-down value:
$('select.previous').change(function(){
if($('select.previous').get(0).selectedIndex == 1) {
$('.otheraccount').addClass('wpcf7-validates-as-required');
} else {
$('.otheraccount').removeClass('wpcf7-validates-as-required');
}
});
The class is getting added, but CF7 isn't able to recognize it as required. Is this possible with jQuery?