Hello - I have a composite multifield which has the below fields. Based on the checkbox selection (If I uncheck), I am making the Product URL field as mandatory which has all the required elements ( aria-required="true"). If I don't select the URL/Type the URL, it is still letting me to submit the dialog which shouldn't happen. But if I enter a space, it is showing as mandatory. is there any way to handle this ?
Solved! Go to Solution.
Views
Replies
Total Likes
Try the below snippet.
$(document).on("change", ".aciveproduct", function(e) {
if($(this).prop("checked")) {
$(this).closest(".coral3-Multifield-item").find("foundation-autocomplete").removeAttr("required");
} else {
$(this).closest(".coral3-Multifield-item").find("foundation-autocomplete").attr("required", "required");
}
});
Hope this works.
Do you have a jquery you have written to handle the same ? I doubt there is something wrong with the logic you have written to make the fields mandatory.
Views
Replies
Total Likes
Try the below snippet.
$(document).on("change", ".aciveproduct", function(e) {
if($(this).prop("checked")) {
$(this).closest(".coral3-Multifield-item").find("foundation-autocomplete").removeAttr("required");
} else {
$(this).closest(".coral3-Multifield-item").find("foundation-autocomplete").attr("required", "required");
}
});
Hope this works.
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies