Solved
The show hide function does not work on click of the add button on multifield.
The show hide function does not work for the new set of fields on click on the add button , but works for the existing fields on the dialog.
The show hide function does not work for the new set of fields on click on the add button , but works for the existing fields on the dialog.
I've implemented a check box to show/hide different fields respectively.
Source: https://blog.3sharecorp.com/show-and-hide-dialog-fields-based-on-any-field-type
var target = $(input).data('cqDialogShowhideTarget');
if ($(input).closest('coral-multifield-item').length) target = $(input).closest('coral-multifield-item').find(target);
var value = $(input).val();
if ($(input).is('coral-checkbox')) value = (!!input.checked).toString();
$(target).each((_, elem) => {
var isHidden = $(elem).attr('data-showhidetargetvalue') !== value;
$(elem).toggleClass('hide', isHidden);
if ($(elem).parent().parent().is('coral-panel')) {
var tabIndex = $(elem).closest('coral-panel').index();
$(elem)
.closest('coral-tabview')
.find('coral-tablist>coral-tab:nth-child(' + (tabIndex + 1) + ')')
.toggleClass('hide', isHidden);
}
if (!$(elem).hasClass('hide')) {
$(elem).siblings().find('coral-select').removeAttr('required');
$(elem).siblings().find('coral-select').removeAttr('aria-required');
}
});
Thanks,
Chinmayi
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.