Hi @sai_santhosht50
You can alert the author on dialog submit. See the below code snippet.
(function (document, $, ns) {
"use strict";
$(document).on("click", ".cq-dialog-submit", function (e) {
e.stopPropagation();
e.preventDefault();
var $form = $(this).closest("form.foundation-form");
let multi = $form.find("coral-multifield");
let val = $(form).find("#dropdown").data('select').getValue(); //coral2 dropdown
//let val = $(form).find("#dropdown")[0].selectedItem.value; //coral3 dropdown
if(val =="select box" && multi.find("coral-multifield-item").length < 3) {
ns.ui.helpers.prompt({
title: Granite.I18n.get("Invalid Input"),
message: "Please Enter atleast 3 items",
actions: [{
id: "OK",
text: "OK",
className: "coral-Button"
}],
callback: function (actionId) {
if (actionId === "OK") {
}
}
});
} else {
$form.submit();
}
});
})(document, Granite.$, Granite.author);
Make sure your dropdown has id, if not change the selector in the above code.
Hope this will resolve issue.
AG