This component will enable the conditional logic functionality.
import {ConditionalLogic} from 'js-pimcore-formbuilder';
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.formbuilder.ajax-form').forEach((form) => {
new ConditionalLogic(form);
});
});
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.formbuilder.ajax-form').forEach((form) => {
new ConditionalLogic(form, {
conditions: {},
actions: {
toggleElement: {
onEnable: function (action, actionId, ev, el) {
console.log(action, ev, el);
}
}
},
elementTransformer: {
hide: function (el) {
el.classList.add('hidden');
}
},
hideElementClass: 'fb-cl-hide-element'
});
});
});