Hi @SixMu
AEM Content Fragment Models don’t support native conditional fields.
Create both fields (fuelType, batteryPower).
Add help text to batteryPower:
“Only fill if fuel type = Electric.”
Add a clientlib for the fragment editor and use JS to show/hide the field:
(function ($, document) {
$(document).on("foundation-contentloaded", function () {
const fuel = $("coral-select[name='./fuelType']");
const battery = $("input[name='./batteryPower']").closest(".coral-Form-fieldwrapper");
function toggle() { fuel.val() === "Electric" ? battery.show() : battery.hide(); }
fuel.on("change", toggle);
toggle();
});
})(Granite.$, document);
Hope this helpful:)
Regards,
Karishma.