1๐
โ
I may be misunderstanding the question a bit here, so if im way off base let me know and iโll delete my answer haha.
why not do an if or switch block statement switched based on the selections to set the required attribute
ie.
`$('#selector').on('change', function() {
if ($(this).val() == "A")) {
$('#inputA').prop('required', true);
$('#inputB').removeAttr('required');
}
if ($(this).val() == "B")) {
$('#inputB').prop('required', true);
$('#inputA').removeAttr('required');
}
});
Thats what i have used on some of my pages in this scenario.
๐คCraig B
Source:stackexchange.com