Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$(document).on("dialog-ready", function () {
$(".js-coral-Multifield-add").click(function() {
var field = $(this).parent();
var size = field.attr("data-limit");
if (size) {
var ui = $(window).adaptTo("foundation-ui");
var totalLinkCount = $(this).prev('ol').children('li').length;
if (totalLinkCount >= size) {
ui.alert("Warning", "Maximum " + size + " links are allowed!", "notice");
return false;
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment