Hi All,
I've got a radio button with 2 values:
1. Standard
2. Breakdown/Emergency
I've also got a field collection underneath with a dynamic required field based on the above selection (Type).
What I'm trying to achieve is set the field (Type) to required in all collection sets (and also figure out how to display the red asterix on the label).
Here's what I have so far
$(document).ready(function(){ $('#q79 input').change(function(){ if ($(this).val() === "Breakdown/Emergency") { $('#q89 select').attr('required', 'True'); $('#q89 select').append('<span class="cf-required">*</span>'); } else{ $('#q89 span.cf-required').remove(); $('#q89 select').removeClass('required').removeAttr('required'); } }); });
So far, it seems to set the first instance of Type (#q89) to required (without the label) but any additional collections are treated as not required.
Any help would be appreciated.
Thanks all.